Skip to content

Instantly share code, notes, and snippets.

@hokuma
Created September 15, 2013 14:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hokuma/6571481 to your computer and use it in GitHub Desktop.
Save hokuma/6571481 to your computer and use it in GitHub Desktop.
自分が投稿したものだけ管理画面で表示する ref: http://qiita.com/halhide/items/8c85d4ea8f8584721aeb
$views = apply_filters( 'views_' . $this->screen->id, $views );
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