Skip to:
Content
Pages
Categories
Search
Top
Bottom

bp_loggedin_user_id() === bp_get_member_user_id() always true?

  • @pardo_bsso

    Participant

    Hi all,
    I’m using BuddyPress 2.0.2 on top of WordPress 3.9.2, running on Linux.

    The problem I’m trying to solve is that for some themes (specially, ) when viewing a profile ( http://mysite/members/some_username ) the buttons like “Add Friend” or “Send Private Message” do not appear.

    I kind of worked around it adding an action to bp_member_header_actions and calling bp_get_button passing block_self=>false, the rest of the arguments copied from BuddyPress internals.

    What I’ve found so far is that within that action bp_get_member_user_id() always returns the logged in user if using that theme (looking at line 1904 of bp-core/bp-core-classes.php ).

    Inspecting the code of bp_get_member_user_id (line 385 of bp-members/bp-members-template.php ) $members_template is NULL when using the stock WordPress themes (so that function returns false, the check inside BP_Button passes and I have them) but on the one I’d like to use it is a populated object.

    I’m blaming this on the theme but that behavior puzzles me.

    Any thoughts?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘bp_loggedin_user_id() === bp_get_member_user_id() always true?’ is closed to new replies.
Skip to toolbar