Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to add custom fields/shortcode in my profile

  • @-q-shadows

    Participant

    I am using mycred on my website and would like to display users rank with logo in the users profile area. I know the shortcode for displaying the rank with image is –

    echo do_shortcode( ‘[mycred_my_rank show_title=”1″ show_logo=”1″ user_id= ” bp_displayed_user_id();'”] );

    The issue I am facing is how do it put this shortcode in the profile area of members without changing the core files.

    Would really appreciate if anyone could provide some help on this.

    Cheers 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • @ckchaudhary

    Participant

    There are many action hooks defined in member templates at different locations. Based on your design, you can hook into any of those and print the output of shortcode.
    For example, to print it in member header, right after last activity update, you can hook into ‘bp_before_member_header_meta’. Untested code :-

    add_action( 'bp_before_member_header_meta', 'myprefix_display_mycred_rank' );
    function myprefix_display_mycred_rank(){
    	echo do_shortcode( '[mycred_my_rank show_title="1" show_logo="1" user_id="' . bp_displayed_user_id() . '"]' );
    }

    @-q-shadows

    Participant

    Can you link me to the list of action hooks available in buddypress.

    PS> I want the rank+logo to appear under the profile menu/tab where by default the Base info is present. Would appreciate if u provide a hook for that.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to add custom fields/shortcode in my profile’ is closed to new replies.
Skip to toolbar