If you’ve multiple authors writing posts for your blogs, you may want each author to only view their own posts in the edit list. By default, it’ll display all the posts to everyone.
Instructions: Add the following code to the functions.php file of your WordPress theme to only show the authors posts in the edit list.
<?php function mypo_parse_query_useronly( $wp_query ) { if ( strpos( $_SERVER[ 'REQUEST_URI' ], '/wp-admin/edit.php' ) !== false ) { if ( !current_user_can( 'level_10' ) ) { global $current_user; $wp_query->set( 'author', $current_user->id ); } } } add_filter('parse_query', 'mypo_parse_query_useronly' ); ?>
You may also enjoy displaying comments in admin to authors own posts only.
$current_user->id is DEPRECATED. Use…
$current_user->ID