wordpress - Remove screen options tab if not admin -


as title suggests, looking way remove screen options tab in post/page editor screen. have found following...

function remove_screen_options(){ __return_false;} add_filter('screen_options_show_screen', 'remove_screen_options'); 

...but removes tab users. keep admins.

regards,

john

found answer after collaboration of of efforts. thank you.

get_currentuserinfo() ; global $user_level;  function remove_screen_options(){ __return_false;} if( $user_level <= 8 ) add_filter('screen_options_show_screen', 'remove_screen_options'); 

you need conditionally check if current user admin. if aren't, remove screen options so:

if ( !is_admin() ) {   function remove_screen_options(){ __return_false;}   add_filter('screen_options_show_screen', 'remove_screen_options'); } 

here official wordpress docs detailing function: http://codex.wordpress.org/function_reference/is_admin


Comments

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -