true, ); $post_types = get_post_types($args);?> 'Subscriber' ) ); $total_count = 0; $user_count=0; foreach($users->results as $data => $user) { $users_id = $user->data->ID; $user_capability = user_can( $users_id, 'publish_posts' ); if ($user_capability): if($user_count < 5): global $wpdb; $total_count1 = 0; $users_name = $user->data->display_name; echo ''; $attachment_count = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->posts WHERE post_type = 'attachment' AND post_author='".$users_id."'"); echo ''; $k=1; foreach ($post_types as $key => $post_type_name) { if ($k<3): if($post_type_name!="attachment"): $post_count = count_user_posts( $users_id , $post_type_name ); echo ''; endif; endif; $total_count = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->posts WHERE post_author ='".$users_id."' AND (post_status = 'publish' OR post_status = 'inherit') AND post_type = '".$post_type_name."'"); $total_count1 = $total_count1 + $total_count; $count_other_posts = $total_count + $count_other_posts; if ($k==3) { $count_other_posts = 0; } $k++; } echo ''; echo ''; echo ''; endif; $user_count++; endif; } echo ''; ?>
Users Media Post Page Others Total
'.$users_name.''.$attachment_count.''.$post_count.''.$count_other_posts.''.$total_count1.'
See all