From kodeboard, 4 Years ago, written in PHP.
Embed
  1. <?php
  2.  
  3. function mypo_parse_query_useronly( $wp_query ) {
  4.     if ( strpos( $_SERVER[ 'REQUEST_URI' ], '/wp-admin/edit.php' ) !== false ) {
  5.         if ( !current_user_can( 'level_10' ) ) {
  6.             global $current_user;
  7.             $wp_query->set( 'author', $current_user->id );
  8.         }
  9.     }
  10. }
  11.  
  12. add_filter('parse_query', 'mypo_parse_query_useronly' );
  13.  
  14. ?>

You must login to reply or comment on this code.