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
1
vote
1answer
917 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' }, ...
2
votes
1answer
735 views

Displaying different custom post types under one admin menu

I am creating multiple custom post types that have hierarchies, and a few of them are strongly related like a parent-child. For example, a house custom post type has bedroom and kitchen custom post ...
1
vote
1answer
496 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
1answer
573 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 ...
4
votes
5answers
6k views

Removing an admin page added by a 3rd party plugin. Gravity forms in this example

I'm trying to hide a help page from editors, added by the gravity forms plugin. I believe I've run into the same issue before with other plugins, so I'd like to know the correct way to do it for 3rd ...
0
votes
1answer
497 views

Custom Admin Menu Order for all User Roles

I've reordered the admin menu items through: function custom_menu_order($menu_ord) { if (!$menu_ord) return true; return array( 'index.php', // Dashboard 'edit.php?post_type=page', // Pages ...
0
votes
1answer
570 views

adding existing menu page on new customer user role

I have created new user role 'Host' . now I am trying to show admin menu item ' user' in it . i have googled some code and tried this $result = add_role( 'Host', __(Host), array( ...
39
votes
7answers
71k 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() { ...
17
votes
10answers
17k 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?
0
votes
1answer
4 views

Highlight active Admin Menu when added though add_menu_page

I added a direct link to a page in the admin menu with the add_menu_page function. Once I click on the link, the About page edit screen opens, great. The problem though, i want the About menu item i ...
0
votes
1answer
532 views

Duplicate “Pages” Item in Admin Menu

I'm registering the following post type: register_post_type( 'post', array( 'hierarchical' => true, 'public' => true ) ); Now I have duplicate "Pages" menu items in WordPress ...
0
votes
0answers
24 views

Confused where some of these admin menu items came from

I am working on a client's site. I noticed they don't have a Post admin menu item and instead have a Products. I also have a download center and a few other admin menu items. However, when I go ...
4
votes
3answers
5k views

Order Admin sub-menu items?

I am adding items to a CPT Admin menu using add_submenu_page which works great, but they are added to the bottom of the sub-menu after the CPT options. I want to be able to have them on top , but I ...
0
votes
3answers
2k views

Remove Elementor Menu From Wordpress Admin

How to remove elementor from wordpress admin menu. I have tried below option but it didnt work. add_action( 'admin_menu', 'my_remove_menu_pages' ); function my_remove_menu_pages() { ...
0
votes
0answers
11 views

How to block the WP admin menus form loading depending on the current URL?

How can I block the WordPress admin menus and admin bar from loading depending on the URL. So that when a user visits a certain page in the admin area he will only see the wp-content block while the ...
0
votes
2answers
661 views

Disable Auto-Expanding Menu in Wordpress Admin Menus

Right now, when I click on a menu item in the wordpress admin menu, the section that that page belongs to is automatically expanded. For instance, if I click on a link in the Settings section then ...
0
votes
2answers
563 views

Is it possible to have dynamic post id # in add_menu_page()?

I use the add_menu_page function in my custom theme builds but when I export my local copy of the site and import it in the production site some of post id numbers change and I have to update this ...
-1
votes
1answer
27 views

Woocommerce like admin tabs and navigation

I'm working on a WooCommerce addon/plugin and created a custom admin sub page under WooCommerce menu in dashboard. Now I am looking to add tabs and sub navigation as per the Settings page under ...
1
vote
2answers
32 views

Bootstrap doesn't work on admin menu page-How to override wp-admin style?

I am building a plugin and i use bootstrap to style it but i notice some components styles don't work properly.Someone suggested in a blog post to use wp_deregister_style('wp-admin'); which did fix ...
2
votes
1answer
767 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 ...
1
vote
1answer
3k 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....
0
votes
1answer
822 views

Remove Theme menu link from Admin Panel

I am trying to remove menu from the admin panel my code works as it removes some pages but i can't remove the following. admin.php?page=ot-theme-options admin.php?page=ot-settings admin.php?page=...
1
vote
2answers
845 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
1answer
785 views

How to override post-new.php with custom template

How can i override post-new.php with my custom template. When i include file or simply redirect i see my template but admin sidebar is missing. I know it is not simple.
0
votes
0answers
12 views

Load admin menu page from plugin class

I'm learning how to create options pages for my plugin. I have found an interesting article on this argument and I'm trying to do the same. I have a doubt about the implementation inside a class. I ...
0
votes
1answer
18 views

How to sorted Parent Page in WP-admin

I have a question. I want to sort pages by title in Page attributes - Parent page in post in WP-admin ?? Any ideas on how to do this?
0
votes
1answer
139 views

wrapping 'rest_api_init' in 'is_admin()' function

i'm create custom admin page via add_menu_page, let's imagine that my custom page has url wp-admin/admin.php?page=settings_page then i'm checki is_admin() function via var_dump on my ...
22
votes
6answers
18k 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?
0
votes
1answer
21 views

Linked pages not working with wordpress

I used this code to create a menu page which loads mypluginpage.php and it works fine with my plugins. I can access it from something like http://mysite/wp-admin/admin.php?page=myplugin <?php // ...
0
votes
2answers
936 views

Hide Theme options and Customize Admin menu

Under the appearance admin menu, I have customizer added by the theme, and theme options added by a plugin. I'm using this code to hide both menus ( submenu's of Appearance )for ALL admins apart from ...
1
vote
1answer
659 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, $...
0
votes
0answers
7 views

API Function to use in place of global $menu?

Just wondering... Googling it I cannot find it. I'd like to not depend on globals at all in any circumstance.
0
votes
1answer
13 views

How to move “Collapse Menu” to top of admin bar?

As stated in the title, I try to perpetually move the "Collapse Menu" button which is normally the very last entry in the admin sidebar (backend) to the top. I googled but can't find any working ...
0
votes
2answers
715 views

Admin menu links just refresh the page

I'm using add_submenu_page() function to add some options to my plugin. On Linux hosting everything works like it should, on Windows hosting those 5 sub-menus have same link somehow and when I click ...
0
votes
0answers
15 views

how add multiple language in wordpress admin menu

How to add multiple language for wordpress admin menu I have added my English menu like this in my theme add_menu_page( "Dashboard Setting", 'Dashboard', 'read', 'user-dashboard', ...
0
votes
1answer
275 views

Move plugin-settings to 'Settings'-menu in the admin

I hate it, when plugins add their own settings like this: It's cluttered and annoying. Can I somehow move them in under 'Settings': I imagined something like, checking if there is a plugin by the ...
3
votes
1answer
35 views

enqueuing React script and hooking its target div fails to load script

I am getting a silent failure on the below code as I try to enqueue a static React.js script and hook its injecting div into the admin_footer. I see the page and my test echo plus the url of the ...
0
votes
0answers
17 views

Trigger refresh of admin menu

Apologies if this isn't an appropriate question for the forum, I'm new to wordpress development and needed to bring this question to some experts. I've written a plugin that creates custom post types....
0
votes
3answers
411 views

How to remove admin menu pages inserted by plugins and themes in the top admin bar?

How do I find out the correct hooks that are being used when installed plugins and themes insert their own menus into the WordPress admin top menu bar? I know how to remove them from the admin ...
1
vote
1answer
218 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 ...
0
votes
1answer
395 views

Limit number of posts under a post type?

I'm building a plugin that registers a custom post type. I'm looking for a way to limit the number of these types of posts at which point the user can no longer 'Add New' posts to this post type. Is ...
2
votes
1answer
450 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', '...
0
votes
0answers
16 views

Simplest way to clear specific wp_postmeta value via a button

I have a submenu in the Admin Tools tab that shows a wp_postmeta record that has been used to capture error logs. I want a simple button to clear the record. Should I use javascript and send a REST ...
10
votes
4answers
6k 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', ...
0
votes
1answer
1k views

Adding direct link to post editor in admin menu

I'm trying to make a shortcut in navigation that will take user to one certain post. So far I'm using add_action('admin_menu', 'add_custom_menu_position'); function add_custom_menu_position() { ...
3
votes
5answers
4k views

Remove Customize Background and Header from Appearance admin menu without CSS or JS

I am trying to remove background and header from appearance menu, but they don't seem to go away! I think it's because I have activated customize, but can I remove them anyway without using CSS or JS? ...
0
votes
0answers
14 views

remove_submenu_page problems

I am trying to remove a admin menu page added by another plugin. I got the settings I want configured so the page is no longer needed. So to reduce clutter, and to prevent an admin from accidentally ...
0
votes
0answers
15 views

Add custom WP-Admin (backend) menu location

I'm having a WP Multisite for dual language site and I'm a bit sick of the standard menu structure. Everything is mooved apart, such as the options etc.. To solve this a want to create an overview ...
1
vote
0answers
17 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 ...
0
votes
1answer
22 views

Remove All in One Pack from the admin bar

Hello I want to remove All in One Pack from the admin bar. I can remove anything else but it. I have already removed other things like update from the admin bar using this method Get the menu's id ...