Support

Account

Home Forums Backend Issues (wp-admin) Field Groups not showing for custom role Reply To: Field Groups not showing for custom role

  • Update,

    i’ve narrowed it down to the fact that i’m using this code to stop anyone who is logged in as a role of school being able to see anyone elses posts.

    function posts_for_current_author($query) {
    	global $user_level;
    
    	if($query->is_admin && $user_level < 5) {
    		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');

    If i remove that, the custom fields show fine.

    Any idea how to modify that code so it doesnt interfere with ACF?