'; echo '
| Users | Attachment | $post_type_name) { if($post_type_name!="attachment"): ?>Total | ||
|---|---|---|---|---|
| '.$users_name.' | '; global $wpdb; if(user_can( $users_id, 'upload_files' )): $attachment_count = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->posts WHERE post_type = 'attachment' AND post_author='".$users_id."'"); else: $attachment_count = 0; endif; echo ''.$attachment_count.' | '; $user_capability = user_can( $users_id, 'publish_posts' ); $total_count1 = 0; foreach ($post_types as $key => $post_type_name) { if($post_type_name!="attachment"): $post_count = count_user_posts( $users_id , $post_type_name ); if($post_count !== '0'){ echo ''.$post_count.' | '; }elseif($post_count==0){ $post_count=0; echo '0 | '; } 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; } echo ''.$total_count1.' | '; ?>
There is no post published by '.$user_info->user_login.'.
'; } ?>