Created
May 23, 2013 15:28
-
-
Save fleeting/5636928 to your computer and use it in GitHub Desktop.
WordPress - Remove Posts menu item in admin area.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*-----------------------------------------------------------------------------------*/ | |
/* Remove Unwanted Admin Menu Items */ | |
/*-----------------------------------------------------------------------------------*/ | |
function remove_admin_menu_items() { | |
$remove_menu_items = array(__('Posts')); | |
global $menu; | |
end ($menu); | |
while (prev($menu)){ | |
$item = explode(' ',$menu[key($menu)][0]); | |
if(in_array($item[0] != NULL?$item[0]:"" , $remove_menu_items)){ | |
unset($menu[key($menu)]);} | |
} | |
} | |
add_action('admin_menu', 'remove_admin_menu_items'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment