Advertisement
fahimmurshed

Hide Page Headers and the Custom Layout options from the Dashboard -> Appearance for the editor role

Aug 30th, 2021
1,265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.45 KB | None | 0 0
  1. add_action('init', 'hide_settings_for_editor');
  2. function hide_settings_for_editor(){
  3.     $user       = wp_get_current_user();
  4.     $user_roles = $user->roles;
  5.  
  6.     if( 'editor' == $user_roles[0] ){
  7.         remove_action( 'admin_menu', array( Astra_Ext_Advanced_Hooks_Loader::get_instance(), 'register_admin_menu' ), 100 );
  8.         remove_action( 'admin_menu', array( Astra_Ext_Advanced_Headers_Loader::get_instance(), 'register_admin_menu' ), 100 );
  9.     }
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement