admin管理员组文章数量:1332403
I have set users to only see their own posts. But the total number of articles is still visible. Can we limit it to its own number of articles? How can it be done without plugins? related picture here:
.jpg
I restricted the users to their own posts with the code below. But as the picture above shows, although the publication is one, the number of publications seems to be four. How can I make the number of publications?
function posts_for_current_author($query) { global $pagenow; if( 'edit.php' != $pagenow || !$query->is_admin ) return $query; if( !current_user_can( 'edit_others_posts' ) ) { global $user_ID; $query->set('author', $user_ID ); } return $query; } add_filter('pre_get_posts', 'posts_for_current_author');
本文标签: Limiting the Number of User Posts to Their Own Posts
版权声明:本文标题:Limiting the Number of User Posts to Their Own Posts 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742277943a2445547.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论