Support

Account

Home Forums Backend Issues (wp-admin) Not compatible with this code? Reply To: Not compatible with this code?

  • Woops – I checked the “this solved it”-button, but I’m still struggling with it.

    I’m not much of a coder, but I tried various ways of coding and thus far without luck.

    Right now I’ve changed it to

    function posts_for_current_author($query) {
    global $user_level;
    
    if($query->is_admin && $user_level < 5 && get_post_type() != "acf") {	
    	
    		global $user_ID;
    		$query->set('author', $user_ID);
    		
    		unset($user_ID);
    	}
    unset($user_level);
    
    return $query;
    }
    
    add_filter('pre_get_posts', 'posts_for_current_author');
    

    But unfortunately that doesn’t change a thing.. Any thoughts?