Skip to content

Instantly share code, notes, and snippets.

@claudioweb
Last active September 25, 2015 14:09
Show Gist options
  • Save claudioweb/d75a16faaf9d8194e936 to your computer and use it in GitHub Desktop.
Save claudioweb/d75a16faaf9d8194e936 to your computer and use it in GitHub Desktop.
Ocultar e renomear menu do wp-admin do Wordpress
/*==================================
= Menu ordem =
==================================*/
add_filter( 'admin_menu', 'ocultar_menu_painel', 999 );
function ocultar_menu_painel() {
global $menu;
// print_r($menu); //Alterar o nome do menu
// $menu[5][0] = 'Fique ligado';
// $menu[5][6] = 'dashicons-rss';
// $menu[6][6] = 'dashicons-calendar-alt';
// $menu[7][6] = 'dashicons-format-gallery';
// $menu[8][6] = 'dashicons-chart-area';
// $menu[9][6] = 'dashicons-lightbulb';
// $menu[100][0] = 'TPL / Contato';
// $menu[101][0] = 'Contatos';
// $menu[102][0] = 'Banner';
// $menu[16][6] = 'dashicons-groups';
// $menu[17][6] = 'dashicons-networking';
// $menu[18][6] = 'dashicons-portfolio';
// $menu[13][6] = 'dashicons-book';
// $menu[12][6] = 'dashicons-lightbulb';
if(!current_user_can('activate_plugins')) { //VERIFICAR PERMISSÃO MAIS ALTA
unset($menu[75]);
unset($menu[25]);
// unset($menu[103]);
}
// $menu[10] = $menu[5];
// unset($menu[5]);
// $menu[100][0] = 'Formulários';
global $submenu;
// print_r($submenu);
// if(!current_user_can('activate_plugins')) { //VERIFICAR PERMISSÃO MAIS ALTA
// unset($submenu['CF7DBPluginSubmissions']);
// unset($submenu['themes.php'][5]);
// unset($submenu['themes.php'][6]);
// unset($submenu['themes.php'][7]);
// }
// $submenu = remove_submenu_page( 'customize.php');
// unset($submenu['index.php'][10]);
// remove_submenu_page( 'index.php' , 'update-core.php' ); //desativados ao usar o wp-config
// remove_submenu_page( 'users.php' , 'import-users-from-csv' );
// remove_menu_page( 'plugins.php' );
}
/*===== End of Menu ordem ======*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment