basmati 4 Report post Posted October 11, 2011 Hi Folks, i'd like to remove the Platform Admin Menu Link for some users - to prevent them from changing important parts of a project. I found this hook - its easy to hide admin links like Plugins, Comments - and it works great in functions.php. But Unfortunately the Pageline Admin Link won't disappear. Any suggestions? Thanks for any ideas! Here's the code: function remove_menus() { global $menu; global $current_user; get_currentuserinfo(); if($current_user->user_login == 'the-user-name') { $restricted = array(__('Posts'), __('Comments'), __('Plugins'), __('Pagelines'), ); 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'); Share this post Link to post Share on other sites
Simon 248 Report post Posted October 11, 2011 [code] function remove_pp_menu() { global $menu; foreach( $menu as $key => $item ) { if ( $item[0] == 'PlatformPro') unset( $menu[$key]); } } add_action('admin_head', 'remove_pp_menu'); [/code] Completely removes platforms admin menu. You may wish to add a user check clause. Share this post Link to post Share on other sites
basmati 4 Report post Posted October 11, 2011 Works perfect! Thats it! Thanks a lot! Share this post Link to post Share on other sites
basmati 4 Report post Posted January 3, 2012 Hide Pagelines Menus for special users (change: "my_user_name" to your personal needs). Use this hook in the functions.php of the base theme within platformpro theme. [code]// additional admin Pagelines Hook function remove_pp_menu() { global $menu; global $current_user; get_currentuserinfo(); if($current_user->user_login == 'my_user_name') { foreach( $menu as $key => $item ) { if ( $item[0] == 'PlatformPro') unset( $menu[$key]); } } } add_action('admin_head', 'remove_pp_menu');[/code] Share this post Link to post Share on other sites
basmati 4 Report post Posted January 3, 2012 one more question for a hook: How can i hide Pagelines Meta Settings by default? Share this post Link to post Share on other sites
basmati 4 Report post Posted January 3, 2012 edit: found a css based solution only: [code]// Screen options add_action( 'admin_head', 'remove_wordpress_cfields' ); function remove_wordpress_cfields() { echo ''; echo ''; } [/code] Share this post Link to post Share on other sites