Skip to main content

Questions tagged [admin-menu]

Usually, plugin and theme authors need to provide access to a settings (options) screen so users can customize how the plugin or theme is used. The best way to present the user with such a screen is to create an administration menu item that allows the user to access that settings screen from all the Administration Screens.

Filter by
Sorted by
Tagged with
72 votes
9 answers
76k views

How do I Enqueue styles/scripts on Certain /wp-admin Pages?

I have two simple functions that load stuff using wp_enqueue_style() and wp_enqueue_script(), something like these: function admin_custom_css() { wp_enqueue_style( 'stylesheet_name', 'stylesheet.css')...
Wordpressor's user avatar
  • 5,051
53 votes
7 answers
108k views

How to remove admin menu pages inserted by plugins?

I've got the following code, which cleans up a lot of stuff that is not going to be used within the admin area: add_action( 'admin_menu', 'my_remove_menu_pages' ); function my_remove_menu_pages() { ...
tmyie's user avatar
  • 873
50 votes
6 answers
94k views

Changing Admin Menu Labels

I have spent the last day using the functions.php file to fully customize WordPress for my client sites. I am amazed at how much I have been able to accomplish and how much easier it will make things ...
Adam's user avatar
  • 565
46 votes
3 answers
69k views

Is It Possible To Add Custom Post Type Menu As Another Custom Post Type Sub Menu

I currently developing a wordpress plugin that is using two custom post types. What I want to know here: is it possible to add a custom post type menu as another custom post type's sub menu?
Ari's user avatar
  • 1,187
34 votes
6 answers
43k views

Is there ANY way to remove comments function and section totally?

I don't want any comment querys to run. I don't wont anything about comments to be shown in wordpress admin area. Is this possible in any way? EDIT: Remove all links to the comments from admin bar, ...
Peter Westerlund's user avatar
27 votes
7 answers
27k views

Add a Separator to the Admin Menu?

Does anyone know how to add an admin menu separator? I found this but it did not help. Any ideas?
user1147's user avatar
  • 802
26 votes
10 answers
37k views

Placing a Custom Post Type Menu Above the Posts Menu Using menu_position?

I just figured out the menu_position parameter it seems like you can place the menu of your custom post type almost everywhere. Except above the Posts menu! How can I accomplish that?
wyc's user avatar
  • 3,897
25 votes
1 answer
4k views

WordPress admin menu formatting issue

I'm having an issue with my admin menu in WordPress. As you can see in the image below the formatting of the menu is out of order. This happens whenever I first land on one of the admin pages but if I ...
brandozz's user avatar
  • 812
20 votes
1 answer
45k views

Adding a custom admin page

I want to add a page of content (a readme file) in the WordPress admin, I can't seem to find how to do this in the codex - can anyone point me in the right direction? It will literally just be a ...
user319940's user avatar
17 votes
5 answers
19k views

Passing arguments to a admin menu page callback?

Situation: I'm working on a plugin and I'm developing it as a class, everything worked fine until I run into this situation. I wanted to make things a bit cleaner and tried this.. class MyPlugin { ...
Luis's user avatar
  • 273
15 votes
5 answers
5k views

How to fix the admin menu margin-top bug in WordPress 5.5?

I recently updated a WordPress instance from 5.4 to 5.5 to end up with an annoying margin-top in the admin area, above the menu directly. I deactivated all plugins, switched themes, did some ...
Braza's user avatar
  • 251
14 votes
5 answers
21k views

How to remove entire admin menu?

I need to customize the admin panel for my user. So how do I remove the entire admin menu? Not remove the menu item, I mean entirely remove the left vertical menu bar, include the design of the menu (...
dev-jim's user avatar
  • 1,988
14 votes
2 answers
2k views

The Great WordPress Admin Menu Challenge of Jan 2011 (a.k.a. How to Resolve Some Challenges when Modifying the WordPress Admin Menu System?)

This question is a bit unique. It is in part a "challenge" I'm issuing to the WordPress team (or anyone else) related to trac tickets: #16048, #16050 and #16204. The Goal The goal is to get ...
MikeSchinkel's user avatar
  • 37.5k
13 votes
4 answers
9k views

Remove duplicate main - submenu in admin?

When I use add_menu_page & add_submenu_page to add menu items, add_menu_page( 'Forms', 'Forms', 'administrator', 'forms', 'forms_job_menupage_cb' ); add_submenu_page( 'forms', 'Job Applications', ...
JM at Work's user avatar
  • 2,323
13 votes
4 answers
13k views

Plugin View Details Link

How do I get the [View details] link to appear on the Plugin admin page in the Description area? The plugin is working fine, the version and authors (with links) show up fine, but no [View details] ...
teracomp's user avatar
  • 133
12 votes
1 answer
3k views

Custom Post Type Settings page, choose page to display archive

So, I followed the accepted answer of this post Possible to add another setting to 'Front page displays' setting for Custom Post Type but didn't entirely work, had to compare against the ...
Luke Wale's user avatar
  • 141
11 votes
5 answers
27k views

Remove Categories / Tags From Admin Menu

I want to remove or hide Categories / Tags submenu under Posts in the Admin Menu. I know this works with the themes submenus: remove_submenu_page( 'themes.php', 'widgets.php' ); The same doesn't ...
Howdy_McGee's user avatar
  • 20.8k
11 votes
2 answers
13k views

How to Add a Third Level Sub Menu to the Wordpress Admin Menu

Is there a function, action or filter that I can use to add a third level drop-down menu to the WordPress admin menu. For instance, right now in the sidebar menu, there is a menu for posts and under ...
Moshe's user avatar
  • 225
10 votes
3 answers
21k views

Add an admin page, but don't show it on the admin menu

I have a custom plugin 'Charts' that has it's own menu. In that menu are links to the 3 pages for the plugin - 'Charts', 'Add Chart' and 'Edit Chart'. However, I don't want to display the link to '...
David Gard's user avatar
  • 3,300
10 votes
2 answers
2k views

Displaying the number of updates available in the Admin area

I am having an issue finding out how to display the number of plugins/updates available to call somewhere else other than the admin header. I found the function wp_get_update_data should be what I ...
Tom's user avatar
  • 105
10 votes
4 answers
9k views

Getting custom admin submenu item to highlight when its active

I have a custom post type, Jobs, with 3 taxonomies under it in the Admin menu. One of the taxonomies is Status, which is either Active or Closed. I want a menu item under Jobs for Active Jobs. I ...
stvwlf's user avatar
  • 466
9 votes
2 answers
27k views

Show Custom Taxonomy Inside Custom Menu

I have a custom menu using add_menu_page: add_menu_page('My menu' , 'Some text', 'read', 'nwcm'); Under it, I show a custom post type menu item; // Create the news custom post type ...
numediaweb's user avatar
9 votes
1 answer
4k views

Put update-like notification bubble on multiple CPTs menus for pending items

Much like how the Plugins or Comments menu items have these number notifications in a bubble for updates and unmoderated comments respectively, I'd like to use that bubble to display the number of ...
Hassan's user avatar
  • 157
9 votes
1 answer
3k views

Custom WP_List_Table displays blank rows

I am trying to make a custom WP_List_Table extension to display a custom post type. Here is what the table and the DOM look like. You can see that it is rendering the table rows empty, and no header. ...
chrispytoes's user avatar
9 votes
2 answers
8k views

Add update notification bubble to admin menu item?

I have re-worded this to make more sense. Ok, I have a plugin that uses a remote service that check for updates, much like default WordPress plugins, in this case it just checks an XML file. I want ...
Wyck's user avatar
  • 18k
9 votes
1 answer
9k views

Adding Category/Tag/Taxonomy Support to Images/Media

I've been trying to add category, tag, or custom taxonomy support to images (or all media, though I'm only concerned with Images). I've got it part-way figured out with: add_action('init', '...
Roxanne Ready's user avatar
9 votes
2 answers
8k views

Meta Boxes: 'admin_init' or 'add_meta_boxes' hook?

When setting up meta boxes in a custom post type I've been do so using the add_meta_boxes hook, e.g. add_action('add_meta_boxes', 'meta_box_setup'); function meta_box_setup() { add_meta_box( ...
sleeper's user avatar
  • 623
8 votes
3 answers
11k views

remove_menu_page doesn't work on custom plugin menus

Using the remove_menu_page() function works for removing the default admin menu items by their slug like so: add_action( 'admin_menu', 'hide_menu' ); function hide_menu() { remove_menu_page( '...
Ethan Rævan's user avatar
  • 4,029
8 votes
2 answers
17k views

Remove "posts" from admin but show a custom post

After checking out: http://codex.wordpress.org/Function_Reference/remove_menu_page, I successfully use the following code to hide some stuff from the menu: add_action( 'admin_menu', '...
Alisso's user avatar
  • 183
8 votes
3 answers
4k views

How to re-enable the links manager?

There is no links manager in the admin_menu of Wordpress 3.5.1 anymore. I'm creating a custom add_links_page, and I'm having a hard time with the making a plugin. Do I need to initialize something to ...
Franz Noel's user avatar
8 votes
2 answers
15k views

Remove a menu item created by a plugin

I'm trying to remove a menu item and tried several approaches, but have not had any luck. It was created from a FAQ plugin. If I use this line: remove_menu_page( 'edit.php?post_type=question' ); ...
John's user avatar
  • 89
8 votes
4 answers
11k views

Run functions only in the admin area?

I'd like this code to only run inside the admin area as it is resorting the items on the public side admin bar too. /* Reorder Admin Menu to put "Pages" at the top */ function menu_order_filter($...
agileapricot's user avatar
  • 1,519
7 votes
3 answers
13k views

How to remove Customize from admin menu bar after WP 4.3

WordPress 4.3 brought more updates to the customizer. It also added a new option at the top admin menu bar that says 'Cusomize' and has a paintbrush. How can I disable this menu from showing up? We ...
jmlumpkin's user avatar
  • 245
7 votes
2 answers
8k views

Modify Admin Bar Link

Starting on line 474 of /wp-includes/admin-bar.php there is a function that is declared as the following: function wp_admin_bar_new_content_menu( $wp_admin_bar ) What it does it generates the + New ...
Zach's user avatar
  • 1,943
7 votes
1 answer
6k views

Admin menu as submenu from another plugin

I would like to add my new developed plugin's admin menu to an existing plugin as sub menu. Would be possible to do this? In my first plugin I initilize the menus as follows: function add_pages() { ...
fefe's user avatar
  • 894
7 votes
5 answers
16k views

Add "external" link to admin menu in the backend

Trying to add a link to my admin menu (dashboard/backend) that leads to the frontend of wordpress, so I basically want a link in the menu that takes me to the blog. I've found a couple of ways to ...
INT's user avatar
  • 1,281
7 votes
2 answers
153 views

Are there any reasons you can't use strings for admin menu positions?

When interacting with the admin menu, for instance via add_menu_page, there is a $position parameter. The inline docs indicate that this should be an integer. The Codex agrees, but adds a note that ...
Matthew Boynes's user avatar
7 votes
1 answer
376 views

Admin settings update updating every time home page is hit?

I have created a plugin that sends an email with all orders placed that day by X o'clock to email Y. I followed the tutorial here: https://scotch.io/tutorials/how-to-build-a-wordpress-plugin-part-1 ...
tjfo's user avatar
  • 191
6 votes
3 answers
4k views

How to limit wordpress menu depth in admin panel

Is it possible to limit maximum menu depth in admin panel /nav-menus.php? I need this because my theme won't support more than two levels of menu, so there is no point in allowing a user to make ...
jmarceli's user avatar
  • 1,076
6 votes
2 answers
9k views

List table not rendering when $this->items is filled

I'm attempting to add a list table to a custom admin page. I've been following this guide and this reference implementation. Unfortunately when I define $this->items to add the data, nothing ...
gandalf3's user avatar
  • 115
6 votes
2 answers
16k views

Creating a WordPress admin page without a menu for a plugin

I am writing a plugin, that will list a number of entries from a custom set of tables. I added the main page for the plugin using the following WordPress functions: // Add menu and pages to ...
Greeso's user avatar
  • 2,204
6 votes
2 answers
4k views

Edit specific nodes in WP_Admin_Bar

Is it easily possible to edit links in the WP_Admin_Bar global $wp_admin_bar instance?
Julian F. Weinert's user avatar
6 votes
4 answers
29k views

Plugin to remove Admin menu items based on user role?

I searched high and low for a plugin that can remove/hide Admin menu items , including custom post types and taxonomies, based on user role. Every one I have tried only does a global hide, not based ...
Wyck's user avatar
  • 18k
6 votes
3 answers
658 views

What's the best method for emptying an option created with the Settings API?

I'm trying to empty an option created with the Settings API and failing. update_option ( 'my_option', '' ); appears to do nothing, whereas delete_option ( 'my_option' ); destroys the whole option ...
jnthnclrk's user avatar
  • 1,845
6 votes
6 answers
7k views

Add separator to admin submenu

I would like to add a separator to the admin submenu section, NOT in the top level section. I'm thinking of using javascript and styling to do the job, but I was wondering if there's a more ...
Giraldi's user avatar
  • 1,485
6 votes
4 answers
30k views

How do I set up a webhook?

I have a simple script that sends Slack messages, runs reports and does other things. I would like this script to run directly based after users purchase something on my site. I do NOT want to build ...
William Entriken's user avatar
6 votes
4 answers
2k views

Add my own button next to "Screen options" and "Help" in the admin

I'd like to add my own button link next to these two. Is this possible?
agileapricot's user avatar
  • 1,519
5 votes
3 answers
6k views

How to remove items from +New admin menu?

I would like to limit the +New admin menu to only show the single sub menu Event ("Veranstaltung"). Basically the users are allowed to create other items as well but not from that +New menu. I ...
sailingthoms's user avatar
5 votes
2 answers
951 views

Add visit site to your toolbar instead of being in the dropdown

I'm looking for a way to move the "Visit Site" link from drop-down and add it to the main toolbar, just like in the image shown below:
andreiudeiu's user avatar
5 votes
1 answer
19k views

How to add custom submenu links in wp-admin menus?

Is it possible to add custom links as submenu on menu that already exist in wp-admin? Like for example, under appearance section like this:
Archangel17's user avatar

1
2 3 4 5
13