Created
November 17, 2014 17:14
-
-
Save alanyoshida/84217daa003a83799d64 to your computer and use it in GitHub Desktop.
Wordpress Snippet - Show only the author's posts in the edit list
This file contains hidden or 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
<?php | |
/* | |
Plugin Name: Simplify Post Edit List | |
Description: Show only the author's posts in the edit list | |
Version: 0.1 | |
License: GPL | |
Author: Sarah Gooding | |
Author URI: http://untame.net | |
*/ | |
function mypo_parse_query_useronly( $wp_query ) { | |
if ( strpos( $_SERVER[ 'REQUEST_URI' ], '/wp-admin/edit.php' ) !== false ) { | |
if ( !current_user_can( 'update_core' ) ) { | |
global $current_user; | |
$wp_query->set( 'author', $current_user->id ); | |
} | |
} | |
} | |
add_filter('parse_query', 'mypo_parse_query_useronly' ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment