Forum Replies Created

Viewing 1 replies (of 1 total)
  • Thread Starter safu9

    (@safu9)

    Sorry, I understand it.
    It is because I added the following code in functions.php

    function get_my_posts( $wp_query ) {
    	global $current_user;
    	if( is_admin() && !current_user_can('edit_others_posts')){
    		$wp_query->set( 'author', $current_user->ID );
    		$screen = get_current_screen();
    	}
    }
    add_action('pre_get_posts', 'get_my_posts' );

    I added “!wp_doing_ajax()” after is_admin().
    It works fine. Thank you.

Viewing 1 replies (of 1 total)