• Hello,

    I’m building some custom templates using Elementor that include author info displayed in a box/card layout, complete with the profile type, bio, and a follow button. I’d love to add the verified badge in front of the author name for any authors who are verified on the platform.

    I need a shortcode that will display the badge if the user in question (determined by providing a user ID) is verified, or output nothing if the user isn’t verified.

    If such a shortcode isn’t available, I can create it myself, if you can provide a function to check if a user (determined by providing a user ID) is verified or not. If the function can also output the badge, even better, but at bare minimum, the function should return true if the user in question is verified.

    Please help.

Viewing 1 replies (of 1 total)
  • Plugin Author Themosaurus

    (@themosaurus)

    Hi @hqraja,

    Sorry for the delayed response.

    To know whether a user is verified or not, you can simply get the user meta called “bp_verified_member”:

    $is_verified = get_user_meta( $user_id, 'bp_verified_member', true );

    Then to get the badge HTML, simply use the following code:

    global $bp_verified_member;
    $badge_html = $bp_verified_member->get_verified_badge();

    When you have both of those values, you can simply display the $badge_html when $is_verified is true.

    Hope this helps!

    Best regards,

Viewing 1 replies (of 1 total)
  • The topic ‘Need shortcode or function to display verified badge in template’ is closed to new replies.