/**
* Remove Globa Styles Menu Item
* Unless user ID is 1
* @since 2.0 2017
*/
add_filter( 'fl_builder_main_menu', function( $menu ){
if ( 1 !== get_current_user_id() ) {
unset( $menu['main']['items'][61] );
}
return $menu;
}, 11 );
1 Like
Nice!
We are using this for Administrator access only.
/**
* Remove Global Styles Menu Item
* Unless user has the 'manage_options' capability
* @since 2.0 2017
*/
add_filter( 'fl_builder_main_menu', function( $menu ) {
// Check if the current user does not have the 'manage_options' capability
if ( !current_user_can('manage_options') ) {
unset( $menu['main']['items'][61] );
}
return $menu;
}, 11 );
1 Like