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.
173
questions with no upvoted or accepted answers
3
votes
1
answer
220
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
0
answers
35
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
0
answers
3k
views
Adding a submenu to the Tools menu returns tools.php in a popup box
I am trying to add a submenu to the Tools menu. When the custom Tools sub-menu is chosen, I want it to call a function. That function will echo things out to the browser page that is loaded. My ...
2
votes
0
answers
4k
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 ...
2
votes
1
answer
80
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
0
answers
578
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
1
answer
979
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
2
answers
638
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
1
answer
1k
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, $...
2
votes
1
answer
4k
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' ...
2
votes
1
answer
546
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
0
answers
22
views
One custom taxonomy with unique sets of labels for two post types?
I’m trying to use one custom taxonomy with different labels for different post types. I have the default “post” post type, and a “podcast” post type. Both post types have an associated Taxonomy with ...
1
vote
1
answer
312
views
Can't add custom post type archive page to menu
I cannot add this custom post type archive page to any menu from the admin. Adding via the front end customizer works fine. Viewing the archive page on the front end also works fine.
My custom post ...
1
vote
0
answers
183
views
admin_enqueue_scripts using hook_suffix vs GET page
My menu code:
add_action('admin_menu', 'waf_admin_menu');
function waf_admin_menu(){
add_menu_page('WordPress Audio Filter', 'WordPress Audio Filter', WAF_CAPABILITY, 'waf_settings', '...
1
vote
0
answers
271
views
Calling the "wp-link-wrap" pop-up modal
When using the ACF, I noticed that the "Select Link" button calls a native modal called "wp-link-wrap". How can I call/access this modal without ACF?
1
vote
0
answers
448
views
Custom post types as sub menu pages and role capabilities issue
I'm working on this:
Create a menu entry in the admin panel name "Products"
Have a dozen of custom post types, all as submenus items of my admin menu "Products" entry
Allow a role ...
1
vote
0
answers
136
views
Set different custom menu items for different user roles
I have added some custom menu using add-menu_page and it is working perfectly with the default administrator admin bar. But when I log in to different user roles, they are not showing. My question is ...
1
vote
0
answers
192
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
1
answer
132
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
0
answers
212
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
1
answer
873
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
0
answers
3k
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
0
answers
99
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
0
answers
413
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
1
answer
73
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
1
answer
236
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
1
answer
515
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
0
answers
26
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
1
answer
119
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
0
answers
145
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
2
answers
838
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
0
answers
156
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
2
answers
200
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
0
answers
569
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
1
answer
972
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
1
answer
60
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
1
answer
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
1
answer
820
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
1
answer
1k
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
0
answers
343
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
1
answer
271
views
Add a page in admin without adding menu item
In my plugin I have registered a menu_page; now I need another page.
How can I add another page to my plugin without adding another menu item?
Is it possible to call it by href?
1
vote
1
answer
133
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
0
answers
149
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
0
answers
3k
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
1
answer
119
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
1
answer
8k
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
2
answers
2k
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 "...
0
votes
0
answers
19
views
How to access admin menu labels and links on front-end?
I am trying to retrieve a list of all the admin menu labels and links on the front-end so I can add them to my admin bar menu. I don't need the submenus. I was hoping to access global $menu, but it ...
0
votes
0
answers
26
views
Create a menu and a submenu
I'm trying to create a menu and a submenu in wordpress, here is the code:
<?php
require_once(ABSPATH.'wp-config.php');
require_once(ABSPATH.'wp-includes/pluggable.php');
require_once(ABSPATH.'wp-...
0
votes
1
answer
148
views
Remove custom menu pages for admin users
I've added some custom menù pages to my WordPress dashboard using the add_menu_page() function. I need to remove these pages for super admin roles, but the remove_menu_page() seems not working. This ...