Created
September 15, 2013 14:57
-
-
Save hokuma/6571481 to your computer and use it in GitHub Desktop.
自分が投稿したものだけ管理画面で表示する ref: http://qiita.com/halhide/items/8c85d4ea8f8584721aeb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$views = apply_filters( 'views_' . $this->screen->id, $views ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function filter_other_post( $wp_query ) { | |
global $pagenow, $current_user; | |
if($pagenow != 'admin-ajax.php' && $pagenow != "edit.php" ) { | |
return; | |
} | |
if($current_user->roles[0] == "administrator") { | |
//管理者はすべて閲覧可能 | |
return; | |
} | |
$wp_query->query_vars['author'] = $current_user->ID; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment