add to functions.php Setting an id on parent menu item allows parent key for submenu items https://davidwalsh.name/add-submenu-wordpress-admin-bar By David Walsh on January 6, 2015
Articles Tagged: Admin Menu
Add Link to WordPress “All-Settings”
As we’ve explained before, WordPress makes it easy to view and edit your blog settings from the Admin area. Thanks to a file named options.php, WordPress will display all of your database settings and enable you to edit a majority of them. To view this page, you need to log in as Admin and enter […]
Another Way to Change the “Howdy” message to “Welcome”
/*************************************************************** * Change Howdy to Welcome ***************************************************************/ function change_howdy($translated, $text, $domain) { if (!is_admin() || ‘default’ != $domain) return $translated; if (false !== strpos($translated, ‘Howdy’)) return str_replace(‘Howdy’, ‘Welcome’, $translated); return $translated; add_filter(‘gettext’, ‘change_howdy’, 10, 3);
Changing “Posts” menu name in admin (e.g. “Articles”)
// hook the translation filters add_filter(‘gettext’,’change_post_to_article’); add_filter(‘ngettext’,’change_post_to_article’); function change_post_to_article( $translated ) { $translated = str_ireplace(‘Post’,’Article’,$translated );// ireplace is PHP5 only return $translated; } Credits to smashingmagazine.com
Remove WordPress Admin Bar Menu Items
function dashboard_tweaks() { global $wp_admin_bar; $wp_admin_bar->remove_menu(‘wp-logo’); $wp_admin_bar->remove_menu(‘about’); $wp_admin_bar->remove_menu(‘wporg’); $wp_admin_bar->remove_menu(‘documentation’); $wp_admin_bar->remove_menu(‘support-forums’); $wp_admin_bar->remove_menu(‘feedback’); $wp_admin_bar->remove_menu(‘view-site’); } add_action( ‘wp_before_admin_bar_render’, ‘dashboard_tweaks’ ); Reference: http://pastebin.com/Wrk0JPxw
Change the “Howdy” message to “Welcome”
This is what is running on this site: function change_howdy($translated, $text, $domain) { if (!is_admin() || ‘default’ != $domain) return $translated; if (false !== strpos($translated, ‘Howdy’)) return str_replace(‘Howdy’, ‘Welcome’, $translated); return $translated; } add_filter(‘gettext’, ‘change_howdy’, 10, 3); With this function you can customize the “Howdy” message in top right of your admin area. This […]
Restrict ADMIN menu items based on username or NOT ADMIN
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’); //alternatively you can use if($current_user->user_login != ‘admin’) instead, […]
Customize the order of the admin menu
tested on: WordPress 3.0.1 This code will allow you to reorganize the order of elements in the admin menu. All that you need to do is click on an existing link in the admin menu and copy everything before the /wp-admin/ URL. The order below represents the order the new admin menu will have. // […]