Questions tagged [add-menu-page]
Add a top level menu page.
105
questions
0
votes
0
answers
31
views
How to Call Specific .PHP file on add_submenu_page selection in Plugin Development?
I want to structure my Plugin folder & file system in a way, where in add_submenu_page when I will click on my sub menu link it will call separate .php file where i will car specific function ...
0
votes
1
answer
49
views
Custom plugin settings link doesn't append current class to menu item when visited? Why?
So I've created a custom setting link on my plugin listing, that takes the user to the plugin settings. However, it doesn't seem to be working as I would expect it to and I'm not sure why. 🤨
To ...
0
votes
1
answer
90
views
Finding the screen id of a page generated with add_menu_page
I'm at a basic level of WordPress + PHP and I'm trying to build a pretty simple plugin.
I've set up the plugin correctly, and the plugin page is generated with
function wpplugin_settings_page() {
...
0
votes
1
answer
14
views
Custom admin menu order fails if slugs are complicated
I'm not able to reorder WP Admin menu items when pages added with add_menu_page have complicated slugs. At least I think that's the problem...
First I create the custom menu items, which is working as ...
0
votes
1
answer
59
views
How to add styles to a submenu page?
I'm relatively new to WordPress and, I am creating this plugin, where I need a submenu page. I have successfully created the main page and have added CSS to it without any problems. However, I came to ...
-1
votes
1
answer
30
views
The menu item is not deleted on WordPress
Doing a WP project and stumbling over commonplace things. The menu item is not deleted.
Video demonstrate this problem
What could be the reason?
0
votes
1
answer
63
views
add sub_menu to a sub_menu (multiLevel sub_menu) in admin menu in wordpress
I'm looking to add a submenu, to another sub_menu that already exists.
In WordPress, there are just 2 levels of admin menu (with functions: add_menu_page and add_submenu_page), my goal is to add ...
1
vote
0
answers
52
views
Auto add (multiple) Custom Post Types to menu
I'm trying to add custom post types entries automatically as submenu's to my main menu. I've managed to add one CPT "nestjes" by using the code below.
Now I would like to add two more CPT's ...
0
votes
2
answers
100
views
Wordpress add page under admin submenu and retaining the active status of the parent submenu page in the menu
I have added a page in the admin menu(pxmag-menu) and a submenu(pxmag-plans). There is another page(pxmag-plans-edit) set under the submenu(pxmag-plans) as the parent page.
public function __construct(...
1
vote
0
answers
38
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
68
views
Check if Page Already Exists in Menu
I am creating a menu where pages are automatically assigned to it. However I need to check whether the page already exists in the menu before adding it.
Currently I am using the following code:
// ...
0
votes
0
answers
46
views
WordPress Settings API Overrides My Previous Value
I have created the following custom menu page to save some data, I've included some repeatable fields inside the form. The problem that I have is that every time I click the submit button it overrides ...
0
votes
2
answers
324
views
WordPress Settings API Repeatable fields
I'm trying to find a way to add repeatable fields inside a custom admin page that I've made.
Code:
/*WordPress Menus API.*/
function add_new_menu_items()
{
add_menu_page(
...
0
votes
1
answer
40
views
only last option from theme options is being saved to the DB
I have this admin page functions where I am trying to prompt the admin for some text data.
the problem that is only the last field is being saved and existed ain the DB, the top ones do not exist in ...
0
votes
1
answer
397
views
Multisite Setup - Menu Items To Reference Pages in Different Subdomains
I have a multisite setup that has two subdomains. The first is site1.example.com which contains pages page1 and page2, and the second subdomain is site2.example.com with pages page3 and page4.
I am ...
0
votes
1
answer
78
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 ...
3
votes
4
answers
10k
views
The seventh parameter passed to add_submenu_page()
I'm testing WordPress 5.3 (5.3-RC4-46673) with my theme. I have WP_DEBUG enabled. I notice the following error in the dashboard now:
Notice: add_submenu_page was called incorrectly. The seventh ...
0
votes
1
answer
195
views
Plugin add_action and add_menu_page
I am using this code to make menu for my plugin. This works well.
My question is: what is the difference between including some php page and enqueue some scripts/styles in foo_admin_enqueue_scripts ...
1
vote
1
answer
914
views
Add_menu_page not displaying the menu in class based plugin
class Cosmo_Games {
public function __construct() {
add_action('admin_menu', array($this, 'create_plugin_settings_page'));
}
public function create_plugin_settings_page() {
$...
0
votes
1
answer
130
views
Add item to admin panel - w/o plugin & theme
I'd like to create a new page in the wp-admin panel. I know I should use the add_menu_page() function for that and I understand how it works.
I'm new to WP development, and would just like to know ...
2
votes
1
answer
172
views
How to avoid creating first submenu page that is same as menu page?
I've created menu page and four submenu pages.
public function onixion_admin_menu_option() {
add_menu_page('onixion','Onixion','manage_options','onixion-admin-
menu',array(&$this, '...
1
vote
0
answers
44
views
add_menu_page the children get url encoded prefix
Here i create the pages:
add_action("admin_menu", "wpa_create_plugin_pages");
function wpa_create_plugin_pages() {
//Add submenu to Users
$wpa_profile = "wpa_user_profile_settings";//parent ...
0
votes
1
answer
225
views
Wordpress custom plugin gives error
I added submenu and admin pages on wordpress custom plugin. But it gives an error.
Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'wstock_variation' not found or ...
1
vote
1
answer
50
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
6k
views
add_menu_page() for more than one user role
If I add a custom page to the wordpress backend menu via
add_menu_page('My Custom Page', 'My Custom page', 'editor', 'custom_page','add_custom_page','dashicons-admin-comments',8);
only a user with ...
0
votes
0
answers
45
views
Create Wordpress Menu Item Without Linking to a Custom Page
With add_menu_page there is a required option to add a menu slug that leads to a admin page. I wish to create a custom admin item, but not one that links to another page (I have other plans for the ...
2
votes
1
answer
5k
views
add_menu_page() with function inside a class [duplicate]
I'm an experienced dev, but new to WordPress. I'm following along with a course on udemy and they suggested I encapsulate my plugin functions in a class to help avoid namespace conflicts. However, ...
0
votes
1
answer
472
views
Not able to show the add_menu_page icon
I am working a plugin development. I want to show an icon on the menu Page. I am using the following code :
add_menu_page('pms_rohitashv','PMS','subscriber','pms_rohitashv-main', plugin_dir_url( ...
0
votes
2
answers
892
views
add page to main menu (frontend)
[LAST UPDATE]
Using get_nav_menu_locations() I'm able to find all menu locations provided by theme and relative menu assigned.
I'm already able to see if a specific menu contains an item related to ...
0
votes
0
answers
62
views
How to create a custom menu for specific user
Hi it is a way to create custom menus for each user and user roles.
Each user needs to have specific page.
0
votes
2
answers
3k
views
How to get data from option page [closed]
https://codex.wordpress.org/index.php?title=Creating_Options_Pages&oldid=97268
This page shows how to create options pages.
// theme-settings.php
<?php
add_action('...
0
votes
2
answers
3k
views
meta box on new admin page
I created a new page for the homepage settings of my theme using add_pages_page(). On that page I want to use wp.media to let the user select one or several images from the library (or upload new ones)...
0
votes
1
answer
413
views
add menu page in loop menu order
I have a function that creates custom admin menu items from an array of child pages.
They seem to get returned in alpha-numeric order.
I would like them to get sorted by the page order set in page ...
0
votes
1
answer
29
views
How do I create a new directory to hold the assets for a new menu item?
I'm a new webmaster, given a WP site to fix. two menu items on the front page are dead since the code does not href a url. I also am not yet a full admin since the Dashboard does not offer ...
0
votes
1
answer
321
views
How can I create a new menu item that links to an archive of a custom post type?
I have a function that programmatically creates menu items in Wordpress. I am able to create menu items to individual pages and posts, but how can I create a menu item for a custom post type archive? ...
0
votes
1
answer
567
views
Show category and tag link as a submenu under custom post type submenu
I have created a college management menu in admin, under that i have added some sub menus those submenus are of different post types. Those were working fine. But Category and tags are not showing as ...
3
votes
0
answers
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, ...
1
vote
3
answers
1k
views
Hiding Admin Page While Keeping Menu Expanded
I am creating a custom admin section. I have the following code:
// Top level menu
add_menu_page('Books', 'Books', 'publish_posts', 'books', 'render_books_page', '', 17);
// Adding this function to ...
1
vote
1
answer
496
views
Add menu option to "New Post" menu in admin bar
I'm trying to figure out how to add an item to the new menu bar. To be clear, I know how to add items to the menu bar. I want to add something new under the bug plus sign in the admin bar. Here's a ...
0
votes
0
answers
30
views
how to create pages and link them to a menu
I am having some issues linking pages to the menus I have created. I used "appearance"-> "Customize"-> "Menu" and created custom menus from there since I cannot access my "Appearance/menu" properly.
...
1
vote
2
answers
4k
views
Insert & order custom post types in/as submenu
TLDR: While in the backend, I would like to add custom post type inside a menu page (which I can do). But I cannot order the resulting submenu pages.
I have 3 custom post types “A”, “B”, “C”, and I ...
1
vote
2
answers
181
views
Wp menu add page link as custom empty link
i've a problem with wp menu, in the admin panel when i try to add a new page link to menu it creates a custom empty link instead, everything was working fine until i installed qtransalte X, when i ...
0
votes
3
answers
618
views
usage of admin_url() in add_menu_page()
Does anybody have experienced this issue:
using admin_url() in add_menu_page() returns an url that contains the domain name twice:
add_submenu_page(
'smart-crm',
__('WP SMART CRM ...
1
vote
1
answer
408
views
Adding subdomain to home_url for "add_menu_page"
I am trying to add a Wordpress admin menu item that will point to a URL which is
http://docs.[currentdomain]
My plugin code is currently:
function user_manual() {
add_menu_page(
__( '...
0
votes
1
answer
105
views
How is a widget supposed to reference what is added to custom submenu or addmenu fields?
Stepping into advanced plugin development I've been following along with the Plugin Handbook but I did not see it mentioned how you're to reference what has been added to the settings page. So for ...
1
vote
0
answers
46
views
Is there documentation reference for forms in menu and setting pages?
Trying to stick to WordPress best practices and improving how I do plugin development I have searched through the codex and developer documentation to see if there is anything indicating what is ...
1
vote
1
answer
2k
views
How to add tags in Submenu page or Menu page
Is it possible to add tags(Like every post) in Submenu page or Menu page?
Without creating custom post type.
I have Menu page and a form in it and I want to add tags in menu page.
2
votes
0
answers
550
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:
...
0
votes
1
answer
2k
views
Adding submenu to custom plugin menu page created with add_menu_page() function
I have created a custom menu page using add_menu_page() function. Everything in that page appears as it should in the screen. What I am trying to achieve is adding another submenu under the under the ...
2
votes
1
answer
149
views
add_page_menu to make shortcut to widgets
I want to make a menu button that takes me to wp-admin/widgets.php. The above code seems to work only partially.
add_action( 'admin_menu', 'register_widgets_menu_button' );
function ...