Changeset 2278 for sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-routes/wporg-gp-routes.php
- Timestamp:
- 01/12/2016 05:07:48 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-routes/wporg-gp-routes.php
r2275 r2278 19 19 public function __construct() { 20 20 add_action( 'template_redirect', array( $this, 'register_routes' ), 5 ); 21 22 if ( defined( 'WP_CLI' ) && WP_CLI ) { 23 $this->register_cli_commands(); 24 } 21 25 } 22 26 27 /** 28 * Registers custom routes and removes default routes. 29 * 30 * Removes: 31 * - API: /languages/$locale 32 * - /languages/$locale 33 * - /languages/$locale 34 * - /languages/$locale/$path 35 * - /profile/$path 36 * 37 * Adds: 38 * - / 39 * - /locale/$locale 40 * - /locale/$locale/$path 41 * - /locale/$locale/$path/$path 42 * - /locale/$locale/$path/$path/$path 43 * - /stats/? 44 * - /projects/wp-plugins/$project 45 */ 23 46 public function register_routes() { 24 47 $request_uri = GP::$router->request_uri(); … … 33 56 GP::$router->remove( "/languages/$locale" ); 34 57 GP::$router->remove( "/languages/$locale/$path" ); 35 GP::$router->remove( '/profile/(.+?)');58 GP::$router->remove( "/profile/$path" ); 36 59 37 60 // Redirect routes. … … 50 73 } 51 74 } 75 76 /** 77 * Registers CLI commands if WP-CLI is loaded. 78 */ 79 function register_cli_commands() { 80 require_once __DIR__ . '/cli/update-caches.php'; 81 82 WP_CLI::add_command( 'wporg-translate update-cache', 'WPorg_GP_CLI_Update_Caches' ); 83 } 52 84 } 53 85
Note: See TracChangeset
for help on using the changeset viewer.