Changeset 9489
- Timestamp:
- 02/11/2020 06:00:12 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-hooks.php
r9487 r9489 18 18 add_filter( 'old_slug_redirect_post_id', array( $this, 'disable_wp_old_slug_redirect' ) ); 19 19 add_action( 'template_redirect', array( $this, 'redirect_update_php_page' ) ); 20 add_action( 'template_redirect', array( $this, 'redirect_legacy_user_structure' ) ); 20 21 add_filter( 'wp_insert_post_data', array( $this, 'set_post_date_gmt_for_pending_posts' ) ); 21 22 add_action( 'wp_print_footer_scripts', array( $this, 'replace_quicktags_blockquote_button' ) ); … … 258 259 wp_redirect( home_url( '/update-php/' ), 301 ); 259 260 exit; 261 } 262 } 263 264 /** 265 * Redirect /users/$id to their new /users/$slug permastructure. 266 */ 267 public function redirect_legacy_user_structure() { 268 if ( is_404() && get_query_var( 'bbp_user' ) && is_numeric( get_query_var( 'bbp_user' ) ) ) { 269 $user = get_user_by( 'id', (int) get_query_var( 'bbp_user' ) ); 270 if ( $user ) { 271 wp_redirect( home_url( '/users/' . $user->user_nicename . '/' ), 301 ); 272 exit; 273 } 260 274 } 261 275 }
Note: See TracChangeset
for help on using the changeset viewer.