I've been studying the source of a plugin which calls the following function to display an image inside of a user's profile (BuddyPress). My aim is to call the exact same function to do the same thing (display an image) BUT inside of the Member's Loop.
require ( dirname( __FILE__ ) . '/includes/buddypress-verified-profile.php' );
function bp_show_verified_badge() {
global $bp;
$is_verified = get_user_meta($bp->displayed_user->id, 'bp-profile-verified', true);
$file = dirname(__FILE__) . '/buddypress-verified.php';
$plugin_url = plugin_dir_url($file);
if ( $is_verified['profile'] == 'yes' ):
?>
<?php if ( $is_verified['image'] == null ): ?>
<span id="bp-verified"><img src="<?php echo $plugin_url; ?>/images/1.png">
<?php else : ?>
<span id="bp-verified"><img src="<?php echo $plugin_url; ?>/images/<?php echo $is_verified['image'] ?>.png">
<?php endif ; ?>
<?php if ( $is_verified['text'] == null ): ?>
<span class="v-text"><?php _e('Verified User', 'bp-verified'); ?></span></span>
<?php else : ?>
<span class="v-text"><?php echo $is_verified['text'] ?></span></span>
<?php endif ; ?>
<?php
endif;
}
add_action( 'bp_before_member_header_meta', 'bp_show_verified_badge' );
add_action( 'bp_members_directory_item', 'bp_show_verified_badge' );
function bp_verified_insert_head() {
?>
What is the right way to use this function to output the image in the members loop?
