[buddypress-trac] [BuddyPress] #5026: bp_get_loggedin_user_nav() - marked as @deprecated, but used in themes

buddypress-trac noreply at wordpress.org
Mon May 27 23:37:58 UTC 2013


#5026: bp_get_loggedin_user_nav() - marked as @deprecated, but used in themes
-------------------------+------------------
 Reporter:  tivnet       |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  lowest       |   Milestone:  1.8
Component:  Core         |     Version:  1.7
 Severity:  trivial      |  Resolution:
 Keywords:               |
-------------------------+------------------
Changes (by boonebgorges):

 * keywords:  needs-patch =>
 * priority:  normal => lowest
 * type:  defect (bug) => enhancement
 * milestone:  Awaiting Review => 1.8


Comment:

 The fact that it's used in themes is not an argument for not deprecating.
 Generally we deprecate functions if we have new methods for accomplishing
 the ends of the deprecated function, and we plan to phase out support for
 the deprecated function. In the case of bp_get_loggedin_user_nav(), we are
 definitely not supporting it anymore - I don't think any changes have been
 made to the function in several years.

 As to whether we have a recommended alternative, it's not as clear. Since
 BP 1.2, BP's packaged themes have used bp_get_displayed_user_nav(), but
 not the logged_in version, presumably because (a) we only render the menu
 on user pages, ie when there's a displayed user id, and (b) we do the is-
 this-my-profile checks when building the nav menus, so we don't need a
 separate function on the way out. And since BP 1.7, we have a very cool
 function `bp_nav_menu()` that spits out the displayed user's nav in a
 nicely nested way.

 However, these functions don't allow you to get the logged-in user's nav
 on a non-user page. So, if bp_get_loggedin_user_nav() does this, I guess
 it does something that we aren't offering an alternative for, and we
 shouldn't drop it. Looking at the source code, it's not obvious to me that
 it *does* do that, though. I have a feeling that if you called this
 function on a group page, you would get gobbldygook. If that's true, it
 should be deprecated.

 You're correct about the comment for the logout link. I'll fix that.

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


More information about the buddypress-trac mailing list