Not able to remove Premium Redirects and Workout admin pages for Editor role
-
Hi, I am having trouble removing submenu page Yoast Premium Workouts anbd Redirects for Editor role. With this code I have been able to remove all Yoast submenu items but the Premium ones like Workouts and Redirects.
function ia_hide_menu_items_for_editor_in_wpadmin() { ? ? if (current_user_can('editor')) { ? ? ? ? remove_menu_page('admin.php?page=ai1ic_settings_page'); ? ? ? ? remove_submenu_page( 'themes.php', 'themes.php' ); // hide the theme selection submenu ? ? ? ? remove_submenu_page( 'themes.php', 'widgets.php' ); // hide the widgets submenu ? ? ? ? remove_submenu_page( 'themes.php', 'customize.php?return=%2Fwp-admin%2Ftools.php' ); // hide the customizer submenu ? ? ? ? remove_submenu_page( 'themes.php', 'themes.php?page=ai1ic_settings_page&tab=tab2' ); ? ? ? ? remove_menu_page('wpseo_dashboard'); //Hide "Yoast SEO" ? ? ? ? remove_menu_page ('admin.php?page=wpseo_redirects', 0); ? ? ? ? remove_submenu_page('wpseo_dashboard', 'wpseo_dashboard'); //Hide "Yoast SEO → General" ? ? ? ? remove_submenu_page('wpseo_dashboard', 'wpseo_page_settings'); //Hide "Yoast SEO → Settings" ? ? ? ? remove_submenu_page('wpseo_dashboard', 'wpseo_integrations'); //Hide "Yoast SEO → Integrations" ? ? ? ? remove_submenu_page('wpseo_dashboard', 'wpseo_tools'); //Hide "Yoast SEO → Tools" ? ? ? ? remove_submenu_page('wpseo_dashboard', 'wpseo_page_academy'); //Hide "Yoast SEO → Academy" ? ? ? ? remove_submenu_page('wpseo_dashboard', 'wpseo_licenses'); //Hide "Yoast SEO → Premium" ? ? ? ? remove_submenu_page('wpseo_dashboard', 'wpseo_workouts'); //Hide "Yoast SEO → Workouts" ? ? ? ? remove_submenu_page('wpseo_dashboard', 'wpseo_redirects'); //Hide "Yoast SEO → Redirects" ? ? ? ? remove_submenu_page('wpseo_dashboard', 'wpseo_page_support'); //Hide "Yoast SEO → Support" ? ? ? ? remove_submenu_page('admin.php', 'wpseo_workouts'); ? ? ? ? remove_submenu_page('admin.php', 'wpseo_wpseo_redirects'); ? ? } } add_action('admin_head', __NAMESPACE__ . '\\ia_hide_menu_items_for_editor_in_wpadmin');
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Not able to remove Premium Redirects and Workout admin pages for Editor role’ is closed to new replies.