Support

Account

Home Forums General Issues Hide menu item not working in ACF 5 Reply To: Hide menu item not working in ACF 5

  • Here’s what I did, since most of the time there are multiple admins on the site but I don’t want any besides myself editing the Custom Fields:

    
    add_filter('acf/settings/show_admin', 'my_acf_show_admin');
    function my_acf_show_admin($show) {
    	// provide a list of usernames who can edit custom field definitions here
    	$admins = array( 
    		'jason'
    	);
    
    	// get the current user
    	$current_user = wp_get_current_user();
    
    	return (in_array($current_user->user_login, $admins));
    }