[buddypress-trac] [BuddyPress] #5122: Add Login/Logout/Register links to Appearance > Menus

buddypress-trac noreply at wordpress.org
Fri Sep 6 02:01:26 UTC 2013


#5122: Add Login/Logout/Register links to Appearance > Menus
-------------------------------------------------+------------------
 Reporter:  ubernaut                             |       Owner:
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  1.9
Component:  Core                                 |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-testing 2nd-opinion  |
-------------------------------------------------+------------------
Changes (by boonebgorges):

 * keywords:  has-patch needs-testing => has-patch needs-testing 2nd-opinion


Comment:

 imath - Bravo! This is a really outstanding piece of reverse-engineering.
 The general technique is a little bit fragile (it depends on some
 specifics of the WordPress implementation of nav menus), but it is an
 extremely ingenious way of skirting the normal nav menu requirements.
 Really great work.

 I've cleaned up your patch, in the form of 5122.04.diff. This patch mostly
 improves the documentation and brings the code in line with WP/BP coding
 standards. I also broke `bp_get_nav_item_pages()` into two functions
 (instead of passing an awkward $selection parameter) and added some
 caching so that the pages wouldn't be built more than once on a page load.

 To the other devs: What imath has done here is, in a nutshell:
 - added a BuddyPress sidebar to Dashboard > Appearance > Menus
 - populated it with checkboxes for Log In/Log Out, Register, and all the
 top-level bp_nav links (like Messages, Friends, Groups, etc)
 - written a filter that will dynamically generate the appropriate links
 for the logged-in user and add them in the appropriate place in the nav
 menu on the front end. So, 'Messages' will not appear for logged-out
 users, while for 'boone' it will point to
 http://example.com/members/boone/messages; likewise, logged-in users will
 see 'Log Out' while logged-out ones will see 'Log In'.

 I think it's overall really clever and could be really useful to lots of
 site owners.

 One small interface question, which has a tricky underlying technical
 underpinning. I think it would be much clearer for the component-specific
 checkboxes to read "My Messages", "My Groups", etc, so as to distinguish
 them from the component directories like "Groups". However, while it's
 easy to tack on "My " in English, this won't work well in other languages.
 Play around with the interface a little to see if you agree.

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5122#comment:19>
BuddyPress <http://buddypress.org/>
BuddyPress


More information about the buddypress-trac mailing list