• Posted: 2012-02-23
  • Author: John Doe
  • Tags:

Only show the authors posts in the edit list

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
<?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' );

?>

Instructions:

Insert this into your functions.php file.

This displays only the authors posts in the lists of posts to be edited.


Related links:
http://wordpress.org/support/topic/manage-your-posts-only?replies=3
Share this snippet

If you like this snippet, share it with friends!