以下のコードをfunctions.phpに記述します。
//画像アップロード非公開
function removemediabuttons()
{
if( !(current_user_can('install_themes')) ) {
remove_action( 'media_buttons', 'media_buttons' );
}
}
add_action('admin_head','removemediabuttons');
function remove_menus () {
global $menu;
if( (current_user_can('install_themes')) ) { $restricted = array(__('')); } // check if admin and hide these for admins
else { $restricted = array(__('Media')); } // hide these for other roles
end ($menu);
while (prev($menu)){
$value = explode(' ',$menu[key($menu)][0]);
if(in_array($value[0] != NULL?$value[0]:"" , $restricted)){unset($menu[key($menu)]);}
}
}
add_action('admin_menu', 'remove_menus');

