Hello
I am in a multisite environnement and would like to hide/desactivated the Avia configuration to Super Admins only.
I try to do as I always do for other plugins : remove_menu_page('avia');
but it still there…
Thank you
I have write the code below in the file: /enfold/framework/php/class-adminpages.php for the function attach_options_to_menu() and it works but don’t like to modify core Enfold file, do you have a better solution?`
function attach_options_to_menu()
{
if(!isset($this->avia_superobject->option_pages)) return;
// BEGIN : MODIFICATION
if ( !is_super_admin() ) {
$current_user = wp_get_current_user();
if ( !($current_user instanceof WP_User) )
return;
$roles = $current_user->roles;
if (in_array(‘administrator’,$roles)) {return;}
}
// END : MODIFICATION
…
…
`
Much, much better:
function remove_menus_avia(){
remove_menu_page( 'avia' );
}
add_action( 'admin_menu', 'remove_menus_avia', 9999);
> Closed :)