When blogger running the multi author blog they always want that each author see only their posts not others posts and It can be very useful to allow each author to only see his own posts in the admin post list. Here is a simple code to display the author posts.
Paste the code below into your functions.php file. Once you saved the file, authors will only see their own posts in the admin post 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' ); ?>
Thanks to WP Snippets for the code!
If you enjoyed this article, please consider sharing it!!
The post How to Only Display The Author Posts in Admin Post List! appeared first on WordPress Experts.