kiyomizu hiroyuki Commented on 2013.04.22 20:41 自分はこんな感じで作ってみました。 /** * 管理者以外は、自分のコンテンツのみ表示 */ function my_pre_get_posts_filter(&$wp_query) { global $pagenow; $user = wp_get_current_user(); if ($user->roles[0] != “administrator”) { $wp_query->set(‘author’, $user->ID); } } add_action(‘pre_get_posts’, ‘my_pre_get_posts_filter’, 10, 1); Merrugh Commented on 2023.03.12 16:44 buy cialis online europe T
![WordPressを複数ユーザーで利用している際に、「投稿」や「メディア」で自分が投稿したもの以外を表示させないようにするコード](https://cdn-ak-scissors.b.st-hatena.com/image/square/616fa2ba91419d91ad4c4297c29dbca06d7ba831/height=288;version=1;width=512/http%3A%2F%2Finspire-tech.jp%2Fwp-content%2Fthemes%2Finspiretech%2Finspiretech.jpg)