BuddyDev

Search

Is there a way to display Custom Xprofile fields using shortcode?

  • Keymaster
    (BuddyDev Team)
    Posts: 21463
    Brajesh Singh on #37310
    This reply has been marked as private.
  • Keymaster
    (BuddyDev Team)
    Posts: 21463
    Brajesh Singh on #37311

    Hi Again,
    Please remove the code from above and download and use the following plugin.

    https://github.com/buddydev/bp-shortcodes

    It allows you to have a lot more flexibility with the shortcode.
    For all available options, Please see
    https://github.com/buddydev/bp-shortcodes/blob/master/src/shortcodes/profile/class-profile-data-shortcodes.php#L65

    Also, I will suggest using

    
    [bpsc-profile-data]
    

    for the shortcode as we plan to keep extending this plugin with new shortcodes.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 1
    Apollo on #40764

    This is great, thankyou. What would I add to this code to say if the custom field is empty “complete profile”

    thank you

  • Keymaster
    (BuddyDev Team)
    Posts: 21463
    Brajesh Singh on #40784

    Hi Apollo ,
    That will need some other shortcode.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 2
    Robert Pleizer on #43349

    Hi Brajesh,

    I am using this plugin. Where can I find all possible shortcodes and examples? Is it possible to adjust for example a data value? For example dd/mm/yyyy?

    For example, the value shown is ‘2022-03-06 00:00:00’ but I would like to have it like 06-03-2022 or even better 6 march 2022. Is this possible?

    Thank you
    Robert

  • Keymaster
    (BuddyDev Team)
    Posts: 21463
    Brajesh Singh on #43367

    Hi Robert,
    Thank you for using the plugin.

    This is a very simple plugin currently. You can just use the field id to show its data.

    You can control how the value is displayed form the date field’s settings in Dashboard->Users->profile Fields and then editing that field.

    Regards
    Brajesh

You must be logged in to reply to this topic.

This topic is: not resolved