Changeset 897 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/redirects.php
- Timestamp:
- 10/10/2014 10:16:40 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/redirects.php
r896 r897 25 25 add_action( 'template_redirect', array( __CLASS__, 'redirect_handbook' ) ); 26 26 add_action( 'template_redirect', array( __CLASS__, 'redirect_resources' ) ); 27 add_action( 'template_redirect', array( __CLASS__, 'redirect_pluralized_handbooks' ), 1 ); 27 28 } 28 29 … … 64 65 } 65 66 67 /** 68 * Redirects requests for the pluralized slugs of the handbooks. 69 * 70 * Note: this is a convenience redirect of just the naked slugs and not a 71 * fix for any deployed links. 72 */ 73 public static function redirect_pluralized_handbooks() { 74 $name = get_query_var( 'name' ); 75 76 // '/plugins' => '/plugin' 77 if ( 'plugins' == $name ) { 78 wp_redirect( get_post_type_archive_link( 'plugin-handbook' ), 301 ); 79 exit(); 80 } 81 82 // '/themes' => '/theme' 83 if ( 'themes' == $name ) { 84 wp_redirect( get_post_type_archive_link( 'theme-handbook' ), 301 ); 85 exit(); 86 } 87 } 88 66 89 } // DevHub_Redirects 67 90
Note: See TracChangeset
for help on using the changeset viewer.