Support » Plugins and Hacks » Manage Your Posts Only

  • makes it so that users and editors can only see posts from the manage tab that they have written themselves. By using this plugin, the only users that can see all posts from the manage tab are Admins.

    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' );
Viewing 2 replies - 1 through 2 (of 2 total)
  • I’m new to WP: where should I locate this code?

    I’ve tried in the Plugins folder, but with no success.. Could you help me out here?

    Thanks!

    Hi,

    Try sticking it in functions.php in your theme folder.

    John

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Manage Your Posts Only’ is closed to new replies.