[buddypress-trac] [BuddyPress Trac] #8320: 404 error for the next page after loading any BuddyPress page

buddypress-trac noreply at wordpress.org
Wed May 22 05:57:42 UTC 2024


#8320: 404 error for the next page after loading any BuddyPress page
--------------------------+------------------------------
 Reporter:  dmcsupport    |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  high          |   Milestone:  Awaiting Review
Component:  Core          |     Version:  6.0.0
 Severity:  critical      |  Resolution:
 Keywords:                |
--------------------------+------------------------------

Comment (by gujjarhere):

 Here's a refactored version of the code following best practices:

 {{{
 // Start: Compatibility fix for BuddyPress members and groups
 if ( function_exists( 'bp_is_user' ) && function_exists( 'bp_is_group' ) )
 {
     $bp_content_slug = '';

     if ( bp_is_user() ) {
         $bp_content_slug = $GLOBALS['bp']->pages->members->slug;
     } elseif ( bp_is_group() ) {
         $bp_content_slug = $GLOBALS['bp']->pages->groups->slug;
     }

     if ( ! empty( $bp_content_slug ) ) {
         $GLOBALS['wp_query'] = new WP_Query( array( 'pagename' =>
 $bp_content_slug ) );
     }
 }
 }}}

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/8320#comment:4>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list