This sweet snippet will be very useful when you need to provide full admin access to your clients but discourge further modifications to your WP site. Thanks to a blog by Jean Baptiste-Jung for this.
Add this code to your theme’s functions.php file. Once you do, voila! the dashboard menu is under your command!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
/*------------------------------------------------------------------------------- Remove Dashboard Menu Items -------------------------------------------------------------------------------*/ function remove_menus() { global $menu; global $current_user; get_currentuserinfo(); if($current_user->user_login == 'username') { $restricted = array(__('Posts'), __('Media'), __('Links'), __('Pages'), __('Comments'), __('Appearance'), __('Plugins'), __('Users'), __('Tools'), __('Settings') ); end ($menu); while (prev($menu)){ $value = explode(' ',$menu[key($menu)][0]); if(in_array($value[0] != NULL?$value[0]:"" , $restricted)) \ {unset($menu[key($menu)]);} }// end while }// end if } add_action('admin_menu', 'remove_menus'); |
Amiable dispatch and this enter helped me alot in my college assignement. Gratefulness you on your information.
Thanks for some quality points there. I am kind of new to online , so I printed this off to put in my file, any better way to go about keeping track of it then printing?
If you are open to having a guest blog poster please reply and let me know. I will provide you with unique content for your blog, thanks.
You have great points there, that’s why I always visit your blog, it seems that you are an expert in this field. keep up the good work, My friend recommends your blog.
My blog:
meilleur taux rachat credit et ficp Rachat de Credit