Skip to:
Content
Pages
Categories
Search
Top
Bottom

Private/Public message button appears on current user Friends tab


  • marcelo2605
    Participant

    @marcelo2605

    I made some changes on BuddyPress theme and now private and public message buttons appears when current user saw his Friends tab.

    I removed this line: do_action( 'bp_member_header_actions' ); from cover-image-header.php file and now the messages buttons appears in user current Friend’s tab, with no href value.

Viewing 8 replies - 1 through 8 (of 8 total)

  • danbp
    Participant

    @danbp

    I made some changes on BuddyPress theme

    – if don’t show what you did, how could it be possible to help you ?

    Revert back step by step to find what you did wrong.


    marcelo2605
    Participant

    @marcelo2605

    I removed this line: do_action( 'bp_member_header_actions' ); from members/single/cover-image-header.php and add it in members/single/home.php file.


    danbp
    Participant

    @danbp

    …and of course the buttons now appear where they don’t as you removed the action hook they use to get fired.

    Put them back (the line you removed goes to line 45 in cover-image-header.php)!
    And tell here what you want to do.


    marcelo2605
    Participant

    @marcelo2605

    I want to put these buttons in another place of the layout.

    That’s why I add this action to home.php file.

    What is the correct way to this?


    danbp
    Participant

    @danbp

    By default these buttons are showing on the profile header.
    The action location is defined in
    /bp-templates/bp-legacy/buddypress/members/single/member-header.php:66
    /bp-templates/bp-legacy/buddypress/members/single/cover-image-header.php:45

    When Profile Cover option is enabled (see bp settings), BP use the cove-image-header file.
    If the option is disabled, he use member-header.

    In both case, these buttons need the displayed_user_id and the loggedin_user_id to work. This means you need to be at least in the member loop.

    You want these buttons to appear elsewhere. OK. But where exactly ?
    Don’t hesitate to provide a screenshot sketching the new place.


    marcelo2605
    Participant

    @marcelo2605

    Thanks for the explanation.

    I think is better to share my members/single/home.php. Here is the link:

    https://gist.github.com/marcelo2605/a0d7cb73902c22af4ca01516269f0cf8

    The action is in line 129.


    danbp
    Participant

    @danbp

    I tested your code and got first a page not found error while trying to send a private message from the new position.
    I deactivated both action hook in cover and home files.
    Disallowed cover image option. And tested again and everithing worked.
    Allowed cover image and worked also.

    So i confirm that your code works and all buttons show up (with active href’s), at least with Twenty Sixteen theme, at the members profile page bottom.

    In resume, the only thing you have to do is to deactivate the original action hook in both files (so you can allow/disallow cover images).

    Forgot to mention that there is a litle error in your code line 133
    <?= wpautop(xprofile_get_field_data("About me", bp_displayed_user_id() ) ); ?>

    Should be
    <?php wpautop(xprofile_get_field_data("About me", bp_displayed_user_id() ) ); ?>


    marcelo2605
    Participant

    @marcelo2605

    Thanks for the help. I will analyse my code.

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.
Skip to toolbar