Skip to:
Content
Pages
Categories
Search
Top
Bottom

Shortcode use in profile fields

  • Avatar of maltech
    maltech
    Participant

    @maltech

    Hi, I have a blog with buddypress being used, and I use the display posts plugin which would provide the functionality I need via use of a shortcode by the authors on their profile page. What I need to do is get buddypress to recognize and use shortcodes instead of outputting the shortcode itself.

    For example when I add a field called My Articles in the profile field under the Author Bio, and add the shortcode [display-posts author="alana"] is just outputs that exact shortcode not the information that should be posted.

    Can someone help me get buddypress to use the shortcode please.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Avatar of Hugo
    Hugo
    Moderator

    @hnla

    You could do this by adding a conditional check around the tr markup in the while loop that generates the field name and data while ( bp_profile_fields() ) : bp_the_profile_field();

    With that check in place you would then remove the bp_the_profile_field_value() function and replace it with something like echo do_shortcode( '[myshortcode user_id=' . bp_displayed_user_id() '] );

    Avatar of maltech
    maltech
    Participant

    @maltech

    Thank you Hugo I appreciate that, it is an elegant solution from the developer side, however with the way these guys keep changing things and adding things I would like to make it simple for them to add stuff themselves. This is why I am seeking a solution that would just allow the use of a shortcode from the profile field editor itself.

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

You must be logged in to reply to this topic.