Skip to content

Instantly share code, notes, and snippets.

@JarrydLong
Created June 23, 2017 07:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JarrydLong/9d46ee80652bc4968e2335b73ba4e4fb to your computer and use it in GitHub Desktop.
Save JarrydLong/9d46ee80652bc4968e2335b73ba4e4fb to your computer and use it in GitHub Desktop.
Only show the departments menu to administrators on the site
add_filter( 'wplc_ma_filter_menu_control', 'wplc_custom_settings_permission_plug', 11, 1 );
function wplc_custom_settings_permission_plug( $array ){
$array[1] = 'manage_options';
$array[3] = 'manage_options';
return $array;
}
add_action( 'init', 'wplc_remove_departments_menu' );
function wplc_remove_departments_menu(){
remove_action("wplc_hook_menu_mid","wplc_pro_department_menu", 10);
}
add_action("wplc_hook_menu_mid","wplc_pro_department_menu_custom");
function wplc_pro_department_menu_custom($cap){
add_submenu_page('wplivechat-menu', __('Departments', 'wplivechat'), __('Departments', 'wplivechat'), 'manage_options', 'wplc-pro-departments', 'wplc_pro_departments_page');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment