Hide widgets/plugins from dashboard

WordPress SEO If you want to remove the admin menu: you can do that with: function hide_wpseo() { remove_action(‘admin_menu’, ‘zeo_options_menu’); } add_action( ‘init’, ‘hide_wpseo’); where it will be removed for all users. WordPress SEO by Yoast To hide the admin menu: and the admin menu bar: one can use: function hide_yoastseo() { remove_action(‘admin_bar_menu’, ‘wpseo_admin_bar_menu’,95); remove_menu_page(‘wpseo_dashboard’); … Read more

How to change admin menu position of “Media”?

There’s a combination of two filters, menu_order does the job, but you also use custom_menu_order to enable menu_order. function wpse_233129_custom_menu_order() { return array( ‘index.php’, ‘upload.php’ ); } add_filter( ‘custom_menu_order’, ‘__return_true’ ); add_filter( ‘menu_order’, ‘wpse_233129_custom_menu_order’ ); This will put upload.php (the Media screen) just after the Dashboard and then the other top-level menu items will follow. … Read more

Theme menu in Admin Panel

You need to register custom menus in your theme – https://codex.wordpress.org/Function_Reference/register_nav_menu You first need to register your menu in functions.php like so: add_action( ‘after_setup_theme’, ‘register_my_menu’ ); function register_my_menu() { register_nav_menu( ‘primary’, __( ‘Primary Menu’, ‘theme-slug’ ) ); } Then, where you want your menu to appear – usually header.php – you call the function: wp_nav_menu()

Hide Theme options and Customize Admin menu

Direct answer: add_action( ‘admin_menu’, function() { global $current_user; $current_user = wp_get_current_user(); $user_name = $current_user->user_login; //check condition for the user means show menu for this user if(is_admin() && $user_name != ‘USERNAME’) { //We need this because the submenu’s link (key from the array too) will always be generated with the current SERVER_URI in mind. $customizer_url = … Read more

How do I alter the position of a Custom Post Type menu item within my plugin admin menu?

As the dashboard uses the menu_position 2, just use menu_position 1. so: $args = array( ‘label’ => __( ‘programmes’, ‘hiblio’ ), ‘description’ => __( ‘Programmes for application from partner organisations’, ‘hiblio’ ), ‘labels’ => $labels, ‘supports’ => array( ‘title’, ‘editor’, ‘excerpt’, ‘author’, ‘thumbnail’, ‘comments’, ‘revisions’, ‘custom-fields’, ), ‘taxonomies’ => array( ‘programmes_categories’ ), ‘hierarchical’ => true, … Read more

How to add taxonomy to Users menu in admin?

The register_taxonomy function is designed only for adding taxonomies to existing post types and custom post types. It’s not something that can be expanded to users. I have just tried a couple of plugins that work with taxonomies and neither are able to attach a taxonomy to a user. from http://codex.wordpress.org/Function_Reference/register_taxonomy : Usage <?php register_taxonomy( … Read more

Removing “Sub-menus” from My Sites Drop-down in Admin Bar

Old question but I just came accros a fix. I hope it helps someone else. Add this to your theme functions.php file add_action( ‘wp_before_admin_bar_render’, ‘remove_mysites_comment_link’ ); function remove_mysites_comment_link () { global $wp_admin_bar; foreach ( (array) $wp_admin_bar->user->blogs as $blog ) { $menu_id_c=”blog-” . $blog->userblog_id . ‘-c’; $wp_admin_bar->remove_menu($menu_id_c); } }

Add management screens to post type

The good news is I have found a solution. The (kind of) bad news is that the menu has to be created manually. It would use a combination of the add_menu_page and add_submenu_page functions. The codex pages have the format for the functions. The menu would be add_action( ‘admin_menu’, ‘register_my_custom_menu_page’ ); function register_my_custom_menu_page(){ add_menu_page(‘My Custom … Read more