Changeset 8225
- Timestamp:
- 02/12/2019 01:57:24 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-hooks.php
r8215 r8225 83 83 // Remove the redundant prefixes in the bbPress <title>. 84 84 add_filter( 'bbp_raw_title_array', array( $this, 'bbp_raw_title_array' ) ); 85 86 // Don't 404 user profile pages. Fixed in bbPress 2.6: https://bbpress.trac.wordpress.org/ticket/3047 87 add_filter( 'bbp_template_redirect', array( $this, 'disable_404_for_user_profile' ) ); 88 85 89 } 86 90 … … 289 293 remove_action( 'wp_head', 'rel_canonical' ); // Doesn't handle pagination. 290 294 $canonical_url = bbp_get_forum_permalink(); 295 } elseif ( bbpress()->displayed_user && bbpress()->displayed_user->exists() ) { 296 // This covers all user pages rather than using 6 different bbp_is_*() calls. 297 $canonical_url = 'https://profiles.wordpress.org/' . bbpress()->displayed_user->user_nicename . '/'; 291 298 } 292 299 … … 755 762 return $title; 756 763 } 764 765 /** 766 * Don't 404 for user profile pages. Fixed in bbPress 2.6: https://bbpress.trac.wordpress.org/ticket/3047 767 */ 768 function disable_404_for_user_profile() { 769 if ( bbpress()->displayed_user && bbpress()->displayed_user->exists() ) { 770 status_header( 200 ); 771 } 772 } 757 773 }
Note: See TracChangeset
for help on using the changeset viewer.