[buddypress-trac] [BuddyPress Trac] #6527: BP mangles $wp_query when viewing member's profile

buddypress-trac noreply at wordpress.org
Mon Jun 29 16:47:59 UTC 2015


#6527: BP mangles $wp_query when viewing member's profile
---------------------------------+------------------------------
 Reporter:  mikelopez            |       Owner:
     Type:  defect (bug)         |      Status:  new
 Priority:  normal               |   Milestone:  Awaiting Review
Component:  Component - Members  |     Version:  2.3.0
 Severity:  normal               |  Resolution:
 Keywords:  2nd-opinion          |
---------------------------------+------------------------------

Comment (by mikelopez):

 Just for the record, got word from our client and said that our update
 fixed the issue reported here.

 Here's what we did in WishList Member just in case someone experiencing
 the same problem is looking for a solution and stumbles on this ticket.

 In our template_redirect hook, we added the following on top:


 {{{
 global $wp_query;

 // Start: Compatibiltiy fix for BuddyPress members and groups
 if ( function_exists( 'bp_is_user' ) && function_exists( 'bp_is_group' ) )
 {
         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 ) ) {
                 $wp_query = new WP_Query( array( 'pagename' =>
 $bp_content_slug ) );
         }
 }
 // End: Compatibiltiy fix for BuddyPress members and groups
 }}}

 Unless anyone from BP thinks that this should be fix, then I think it's
 fine to mark this as resolved already.

 Thanks guys!

 Mike

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


More information about the buddypress-trac mailing list