true, ); $post_types = get_post_types($args);?>
| Users | Media | Post | Page | Others | Total |
|---|---|---|---|---|---|
| '.$users_name.' | '; $attachment_count = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->posts WHERE post_type = 'attachment' AND post_author='".$users_id."'"); echo ''.$attachment_count.' | '; $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 ''.$post_count.' | '; 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 ''.$count_other_posts.' | '; echo ''.$total_count1.' | '; echo '|
| See all |