[buddypress-trac] [BuddyPress Trac] #5722: Theme compat does not recognize single member page if no subnav item is registered

buddypress-trac noreply at wordpress.org
Fri Jun 20 16:15:15 UTC 2014


#5722: Theme compat does not recognize single member page if no subnav item is
registered
--------------------------+-----------------------------
 Reporter:  boonebgorges  |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Core          |    Version:
 Severity:  normal        |   Keywords:
--------------------------+-----------------------------
 Consider a simple implementation of `BP_Component` that does not need a
 subnav. The logical way to do this is to register no subnav items in
 `setup_nav()`:

 {{{
 public function setup_nav( $main_nav = array(), $sub_nav = array() ) {
     $main_nav = array(
         'name' => 'Foo',
         'slug' => 'foo',
         'screen_function' => 'foo',
     );
     parent::setup_nav( $main_nav, $sub_nav );
 }
 }}}

 However, when setting it up this way and then visiting
 example.com/members/yourname/foo/, the Members directory template loads.
 That's because the Members component theme compat will not recognize this
 as a single member page, due to the fact that `bp_current_action()` will
 be empty. See https://buddypress.trac.wordpress.org/browser/tags/2.0.1/bp-
 members/bp-members-screens.php#L296 (line 303)

 I have a feeling that what's needed is just to switch this logic around,
 so that the check is more like `if ( bp_is_user() ) { // single } else {
 // directory }`, but this will obviously take some testing.

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5722>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list