07788 994423 ยท contact@soliddigital.io

Hide the ACF menu and show for a specific user only

When delivering a website to a client, it may be beneficial to hide the Advanced Custom Fields menu item. This will prevent your client from changing/deleting fields and will keep the website running smoothly.

Place code in your functions.php


add_filter('acf/settings/show_admin', 'my_acf_show_admin');
function my_acf_show_admin( $show ) { 
if ( get_current_user_id() == "1" ){
return true; // show it
   }
else {
return false; // hide it
   }
}