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.

176 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3
votes
0answers
1k views

How to change menu page capability

Is it possible to change the capability set for a menu page, previously added with add_menu_page()? I have a third plugin installed, that set a menu page created with a 'manage_options' capability, ...
3
votes
1answer
89 views

Detecting when a custom taxonomy has been changed and display alert?

I'm building a plugin with a CPT and custom taxonomy - location. Everything's been working fine except I need to add a dismissible admin alert when the custom taxonomy has been changed either from the ...
2
votes
0answers
45 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 immediately. I deactivated all plugins and switched themes and did some ...
2
votes
1answer
824 views

wp_verify_nonce() why return false?

I was to tried create theme options admin page (without settings API) in this code I'd like to know why wp_verify_nonce return false: main file <?php add_action('admin_menu', '...
2
votes
0answers
20 views

How do I insert the smaller variant of an image?

I noticed that when I upload an image in my media library, WordPress seems to automatically generate smaller versions of the image: However, I don't know how to access these smaller versions when I ...
2
votes
1answer
40 views

How to change page via login as user and admin

I am using WordPress and I'm trying to develop eCommerce website using WooCommerce. When a user logs in I want to show the following in the menu-bar: Product Category Users profile Orders Cart Then, ...
2
votes
0answers
518 views

Why add_menu_page adds admin.php and how to remove it?

I'm trying to add custom menu items for my Custom Post Type. I've added "show_in_menu" => false in my CPT definition so it will not show in admin menu. Then I've added to admin_menu action: ...
2
votes
1answer
889 views

reorder plugin menu position

Looking for a function that I can use to reorder the admin position of a 3rd party plugin, and that will still work once said plugin gets updated. Backstory AIO webmaster and All In One Events ...
2
votes
2answers
179 views

How do I remove the entire left nav bar in admin for certain level users?

I know how to remove items from the left nav bar (hook into admin_menu and do global $menu; unset( $menu[ __( "Posts" ) ] ); for example). But it still shows a left nav bar (with nothing on it). I ...
2
votes
1answer
327 views

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

How does one remove the "sub-menu" that appears to the right of each site listed in the My Sites drop down from the admin bar? That is, I want to have a list of My Sites without the Dashboard/New ...
1
vote
0answers
22 views

Show/Hide 'add new user' custom fields in wordpress admin panel by click another field

I have created a custom field in the 'add new user' section using this hook "user_new_form" in the wordpress admin panel. Now I want to show or hide this field on the base of role. Can ...
1
vote
0answers
28 views

How to display options page under custom menu?

SOLVED: I managed it to solve by using add_sub_menu I have this code to create an options page. But this shows under the setting( code is from WordPress documentation. I want to display it under my ...
1
vote
1answer
56 views

is it recommended to use WP_List_Table?

At moment i am developing a Wordpress-Plugin where I have to print a custom table in the admin-menu. After a short research I found the solution with WP_List_Table. But on the Class Reference from ...
1
vote
0answers
70 views

How to access $menu variable in custom .PHP file that loads wp-load.php?

I have a file custom.php inside the WP root folder. My goal is to access the GLOBAL $menu variable that stores the admin menu items. In order to do that, I try loading the WordPress environment. <?...
1
vote
1answer
159 views

Plugin sub-menu pages recommended structure and links

Sorry if this has been asked before; I have been looking for a while, but couldn't find anything directly applicable. I am building my first plugin and I am trying to follow the WP best practices. My ...
1
vote
0answers
901 views

Wordpress menu not loading in the admin side appearence-> menu tab

Uncaught ReferenceError: columns is not defined load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-widget,jquery-ui-mouse,jquery-ui-sortable,jquery-ui-draggable,...
1
vote
1answer
283 views

How To Remove or Hide Appearance->Background from Admin Menu

I have a menu Appearance->Background on WP admin, i want to remove or hide from Editor user. i was try to using public function remove_menu() if( !current_user_can( 'administrator' )){ { if( !...
1
vote
0answers
47 views

Move 'current-menu-item' class on #adminmenu li from Posts to Pages for Taxonomy Edit Screen

I've created a custom taxonomy called 'venuecategory' that is hidden by design(not attached to a CPT and does not appear in admin menu). When I'm on this taxonomy's admin page ('wp-admin/edit-tags....
1
vote
0answers
150 views

Create form on plugin options page that creates submenu pages for that plugin

I've created a plugin that adds an admin menu section that is visible to clients (Client Section) when they login and another that is only available to our staff (Staff Section). Our staff needs to ...
1
vote
1answer
32 views

Able to edit custom post, but unable to create new custom post when within submenu. What capability is missing?

I'm encountering funny behaviour with a custom post of mine that I'm working with in a plugin of mine. Here are the arguments of the custom post: array( 'label' => [omitted], 'labels' =>...
1
vote
1answer
53 views

Programmatically add existing pages and subpages to Appearance Menu

I have inherited a site with over 600 pages/subpages. I plan to use a plugin to change the way the navigation displays but it requires the pages to be in the Appearance -> Menu in this page: /wp-admin/...
1
vote
1answer
98 views

Add Custom Post Type as top level menu item for a custom page

I am writing a plugin and I have added a custom post type register_post_type( 'my_cpt', $args); I would like to have it linked to the custom admin menu I have created using add_menu_page( 'Page ...
1
vote
1answer
316 views

Need Help Figuring Out Admin Menu Hover Styling Class

I am building a plugin that part of it has to do with styling the WordPress Dashboard Admin menu. I have everything all coded and working I am just stuck on this one piece. I need to find the CSS ...
1
vote
0answers
21 views

Manipulate javascript code from custom made admin page menu

I have javascript peace of code that I load into my custom template page. It is quiz application based on pure javascript and I keep the questions with answers inside the array object. The thing is ...
1
vote
1answer
71 views

Add Custom Post type menu to another menu in specific location

It is possible to add the menu for a custom post type beneath another menu (in my case a custom one that I have created) but this appears as the first item. How exactly do I move this to a different ...
1
vote
0answers
119 views

Show woocommerce categories on my theme menu styling

I am modifying a Theme I purchased since it is not prepared for woocommerce. It has an option to select a megamenu from a dropdown list on the menu where it says not megamenu. This is the code I find ...
1
vote
2answers
460 views

WordPress Plugin menu position overwrite other item

i've got a question. I created a plugin with a menu and i want to show this under the Dashboard menu-item. In some of my wordpress installations the dashboard item will be overwrited. How can i fix ...
1
vote
0answers
128 views

Role capability issue

I have a custom sub menu item that has been setup for a long time and all of a sudden today one Role cannot see the item on the Tools menu. They can see a couple of other items on that same Tools menu ...
1
vote
2answers
58 views

How to remove post listing page for a custom post type

I want to provide functionality to create a single post into my custom post type. And for this, when user click on main option (name of post) at left side bar in word-press back-end It's automatically ...
1
vote
0answers
3k views

Widget page is missing from menu and default widgets are not showing

Necessary background information: I'm working on a website which were first developped by an other web agency. So I don't have all of the history of the project. I have an issue with a Wordpress ...
1
vote
0answers
479 views

Admin menu in front-end

How to move an admin menu from backend to front-end ? Menu is create with add_menu_page($menu_slug) and the URL is like abc.com/wp-admin/admin.php?page=$menu_slug. I need to use the admin page on ...
1
vote
1answer
516 views

Remove or move admin submenus under a new menu

I'm coding a new Wordpress plugin that registers several new post types. They all have their own menu and submenus in the Wordpress backend. How could create a new menu (like a parent category) and ...
1
vote
1answer
54 views

Suggestions on Approach to New Plugin I'm Stuck On

I'm a newbie plugin developer, and I've had an idea for what I though would be a simple to build debut plugin, but I seem to have reached a brick wall with it and wonder if anyone can suggest some ...
1
vote
1answer
1k views

Show media-frame-menu on custom Media Frame

I have a plugin I built that adds a custom media frame with the following: media_frame = wp.media.frames.media_frame = wp.media({ title: 'Select your images', button: { text: 'Use Image' }, ...
1
vote
1answer
642 views

Pagination in plugin's backend

I am displaying a list of posts in the plugin backend but I can't seem to get the pagination to work. I used the standard approach of getting the "paged" variable and then passing it to get_posts()'s ...
1
vote
1answer
670 views

Admin custom option screen not saved unless user manage_options capability

I am running into exactly the problem described by this Trac: https://core.trac.wordpress.org/ticket/14365 I see that one of the devs added a Diff here: https://core.trac.wordpress.org/attachment/...
1
vote
0answers
189 views

Dynamic admin submenu

I'm creating a plugin for WordPress with dynamic sub-menu's fetched from the server. Putting the dynamic loading of sub-menu's into the menu_setup() hook function would slow down other WordPress ...
1
vote
1answer
123 views

WP Plugins - Use includes to display page content

So I have a plugin I have been working on. It adds a menu and multiple submenus. Each submenu page contains a form, this form is created in a function called add_content_submenupagename. This ...
1
vote
1answer
713 views

Is there any way to add absolute path for add_menu_page function?

I am creating a plugin for add menu option to WordPress admin and using below function for that: <?php add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $...
1
vote
0answers
119 views

What action/filter/function determines “current” class in WP Admin Menu

I have created a submenu page for the Media List Table. The link actually points to a custom view I have created called Resources. I am looking for the correct location where the Admin menu determines ...
1
vote
0answers
2k views

Call to undefined function add_menu_page() on theme activation

I am attempting to activate a theme that works perfectly on one WordPress install. I have matched the plugins installed up and copied the theme over but when I go to activate it I get... Fatal error:...
1
vote
1answer
111 views

page not updating with database

I have code which updates the database fine, but the page doesn't update correctly! I have to refresh the page a second time for it to update correctly. Here is the code below (funcitons/admin-...
1
vote
1answer
4k views

500 internal server error on wp-admin only

I am getting a 500 internal server error when I try to log into www.mysite.com/wp-admin/ and www.mysite.com/wp-login.php. The actual site is up and running just fine so it cannot be a database error....
1
vote
2answers
1k views

How to add taxonomy to Users menu in admin?

I want to create a taxonomy that is related to the users, therefore I'd like to show the taxonomy under "Users" menu within wordpress admin. In codex there's a mention that you can attach taxonomy to "...
1
vote
1answer
3k views

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

I'm writing a plugin (for the first time, so bear with me!) which includes a custom post type; 'Programmes'. In the admin menu, I've set up a new menu group for the plugin, and I have the 'Programmes' ...
0
votes
0answers
7 views

How to customize the default users page in admin panel?

I'm trying to add a new feature to the admin panel that enables filtering users using specific field. and I'm wondering is it better to add new page with this functionality or to add the functionality ...
0
votes
1answer
10 views

Is there a way to display a custom post type menu item as “users” submenu?

"client" is a custom post type because I have to add several metaboxes. For a better ergonomy on admin side, I would like to add my custom post type "client" as "users" ...
0
votes
0answers
9 views

add_submenu_page - cannot change slug

I have a problem in my plugin adding a submenu. It works as an administrator user, but if I run as a user who is not admin, it will not work. I am adding my menus as below. add_action( 'admin_menu'...
0
votes
0answers
18 views

add menu page not showing Icon

I have issues with add menu page it doesn't show my custom Icon. class V { function __construct() { add_action('admin_menu',array($this,'add_plugin_menu')); } ...
0
votes
0answers
53 views

Error on clicking 'Screen Options' tab only at Products-related editor screen(s) and for specific user

My client has problems with the Screen Options tab and in general with Javascript (or maybe WPBakery) related parts of the Admin screen. WPBakery-s blue buttons are not displaying to him at all. And ...