Home › Forums › General Issues › Hide menu item not working in ACF 5
Hi there,
I have 2 users, one called admin (admin) and the other called nic (editor).
When I place the required code from here to hide the ACF admin menu from the ‘nic’ user, including updating the array to enable the admin user only, the ‘nic’ user can still see the ACF admin menu item.
Hi, I’m experiencing the same problem BUT it’s only happening when I add the code featured here:
http://www.advancedcustomfields.com/resources/how-to/how-to-hide-acf-menu-from-clients/
into my CHILD THEME functions.php.
This problem does not occur when the code is placed in the parent theme’s functions.php
Could you let me know if you’re using a child theme?
No I am not using a child theme.
The function is actually working for me now. I am now running ACF 5.03, but am not sure if the updates fixed my issue or not.

function remove_acf(){
remove_menu_page( 'edit.php?post_type=acf' );
}
add_action( 'admin_menu', 'remove_acf',100 );
I made this way…
add_filter('acf/settings/show_admin', '__return_false')
really not working
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));
}
Anybody else having problems using the filters?
There is no reaction and the menu still available
The topic ‘Hide menu item not working in ACF 5’ is closed to new replies.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.