[buddypress-trac] [BuddyPress Trac] #5441: Profile Settings show "Email" sub tab even if content is empty

buddypress-trac noreply at wordpress.org
Thu Jul 31 15:45:01 UTC 2014

#5441: Profile Settings show "Email" sub tab even if content is empty
 Reporter:  landwire                    |       Owner:
     Type:  defect (bug)                |      Status:  new
 Priority:  normal                      |   Milestone:  2.1
Component:  Settings                    |     Version:  1.9.2
 Severity:  normal                      |  Resolution:
 Keywords:  needs-patch good-first-bug  |
Changes (by DJPaul):

 * keywords:  needs-patch => needs-patch good-first-bug


 I've marked this as `good_first_bug`, though it's a little more
 complicated to understand than some of the others as it involves the black
 box that is BuddyPress' navigation/route building code. :) Maybe good if
 you've submitted a few patches to BuddyPress before, or are an experienced
 WordPress developer. Adventurous explorers should grab a machete and take
 the following to heart:

 * Recreate the issue by going to [your profile] > settings, when you ONLY
 have the Members and Settings component active. You should see what
 williamsba1 included in his screenshot.
 * The email navigation menu/item is added here:
  * You should be able to comment that block out and see the subnav
 disappear; in fact, if you were on the email settings screen when you make
 this change, the request should 404 as the nav item doesn't exist.
  * Another way to remove the nav item is something like this (untested):
 `bp_core_remove_subnav_item( buddypress()->settings->slug, 'notifications'
  * The component class' `setup_nav` methods are invoked by the
 `bp_setup_nav` action.
 * I think the tricky part is deciding when/where to remove the code.
 Adding a conditional block around the segment in `bp-settings-loader.php`
 is tempting, but due to possible load order problems, and to make it easy
 for developers to un-hook, it should probably be done in a separate
 function. I'm not sure where to suggest this should be done; perhaps late
 (`> 10`) to `bp_setup_nav`.

Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5441#comment:5>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac

More information about the buddypress-trac mailing list