Hi @Irfantony,
thanks for reaching MainWP.
You can use this code to unset certain Menu items:
Settings page example:
add_filter( 'mainwp_main_menu_disable_menu_items', 'mycustom2_mainwp_main_menu_disable_menu_items' );
if ( !function_exists( 'mycustom2_mainwp_main_menu_disable_menu_items' ) ) {
function mycustom2_mainwp_main_menu_disable_menu_items( $disable_menus ) {
if (isset( $disable_menus['level_2']['Settings']) ){
$disable_menus['level_2']['Settings'] = true;
}
return $disable_menus;
}
}
Status page example:
add_filter( 'mainwp_main_menu_disable_menu_items', 'mycustom2_mainwp_main_menu_disable_menu_items' );
if ( !function_exists( 'mycustom2_mainwp_main_menu_disable_menu_items' ) ) {
function mycustom2_mainwp_main_menu_disable_menu_items( $disable_menus ) {
if (isset( $disable_menus['level_2']['ServerInformation']) ){
$disable_menus['level_2']['ServerInformation'] = true;
}
return $disable_menus;
}
}
Now, if you need this only for a specific role, you can wrap this code with a IF condition:
if( current_user_can( 'user-role-here' ) ) {
// code snippet here
}
I hope this make sense, let me know how it goes.