I'm using Profile Builder for display all users page. Like this picture enter image description here
Users of Theme installed do not crete Posts but Listing. So, instead the posts number in the label of the picture I need listings number.
Plugin have this code for display the posts number:
function wppb_userlisting_show_number_of_posts( $value, $name, $children, $extra_info ){
$userID = wppb_get_query_var( 'username' );
$user_id = ( !empty( $extra_info['user_id'] ) ? $extra_info['user_id'] : '' );
$user_info = ( empty( $userID ) ? get_userdata( $user_id ) : get_userdata( $userID ) );
$allPosts = get_posts( array( 'author'=> $user_info->ID, 'numberposts'=> -1 ) );
$number_of_posts = count( $allPosts );
return apply_filters('wppb_userlisting_extra_meta_number_of_posts', '<a href="'.get_author_posts_url($user_info->ID).'" id="postNumberLink" class="postNumberLink">'.$number_of_posts.'</a>', $user_info, $number_of_posts);
}
add_filter( 'mustache_variable_number_of_posts', 'wppb_userlisting_show_number_of_posts', 10, 4 );
And in my Theme I can use this code for display the listings number:
$listng_data = $CORE->USER("count_user_listings", $userdata->ID);
$num = $listng_data['total'];
<?php echo $num; ?>
Thanks in advance for any help
I try a lot of combination but this variable is not accepted $CORE->USER("count_user_listings", $userdata->ID); The php file of the plugin is made only of "functions"