Skip to:
Content
Pages
Categories
Search
Top
Bottom

Custom info near username


  • robertosalemi
    Participant

    @robertosalemi

    Hi,
    i would show custom information in the user profile page near username.

    So I used:
    add_filter( ‘bp_get_displayed_user_mentionname’, ‘bpfr_add_mention_from_profile’ );

    The information are shown correctly, but it are shown near button of functions:
    Custom Info near Username

    Why?

    Thanks.

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

  • shanebp
    Moderator

    @shanebp

    Because that’s ‘where’ the hook is.

    Take a look at
    buddypress\bp-templates\bp-legacy\buddypress\members\single\member-header.php

    Use one of the do_action hooks or create a template overload of that page and put your code in it.


    robertosalemi
    Participant

    @robertosalemi

    Hi @shanebp,
    how can I use my function bpfr_add_mention_from_profile() with do_action?

    In member-header.php for shown user-nicename there is function bp_displayed_user_mentionname();

    Thanks for the support.


    shanebp
    Moderator

    @shanebp

    Please use pastebin to show us your function.


    robertosalemi
    Participant

    @robertosalemi

    Hi #shanebp,
    this is my function.

    Thanks.


    shanebp
    Moderator

    @shanebp

    For your situation, it would be easier to use a template overload.

    Then you can arrange the header exactly as you want it.

    And you should not be using add_filter.
    Filters change the markup output.

    You should use add_action.
    Maybe this hook in member-header: do_action( 'bp_before_member_header_meta' );
    Or add your own do_action hook in your template overload.


    robertosalemi
    Participant

    @robertosalemi

    Ok, I will try to follow your way.

    Thanks.


    robertosalemi
    Participant

    @robertosalemi

    Hi @shanebp,
    I try to use
    do_action( 'bp_before_member_header_meta' );
    but I not managed to work with this.

    At the moment, I continue to use my function and I have hidden the error between the button with CSS code.

    🙁

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Custom info near username’ is closed to new replies.
Skip to toolbar