Questions tagged [add-menu-page]

Add a top level menu page.

Filter by
Sorted by
Tagged with
0 votes
0 answers
13 views

How to show metabox in custom php menu page

I've created a custom dashboard for wordpress and I want to show some custom metabox on it. Is there any way to achive this with a filter or function of wordpress? I've tried using the do_meta_boxes() ...
ICTDEV's user avatar
  • 113
0 votes
0 answers
21 views

Add submenu page to a custom menu page

For a company project I'm fully customizing the wordpress wp-admin dashboard to be the front end after an user is logged in. I need to hide the admin bar for non admin users and add a submenù to a ...
ICTDEV's user avatar
  • 113
0 votes
0 answers
14 views

Multiple plugins settings of same developer into ONE settings page linked together

Im quite new to wordpress and plugins. I'm still a student so im still in the learning curve. Thank you in advance for reading my question CONTEXT Each plugin is a plugin on its own but made by the ...
MiYuKuro's user avatar
1 vote
0 answers
80 views

Change default URL (or permalinks) in the back-end

Assume I have the following code add_menu_page('My Title', 'My Title', 'publish_posts', 'my-slug', function () { require_once ('path/to/render/page.php'); }); This code will add a menu item to ...
Greeso's user avatar
  • 2,116
0 votes
1 answer
69 views

Footer navigation menu

Our website is https://de.ferberg.com and we are a manufacturer of warehouse equipment and mobile loading ramps. On our site the navigation menu is added to the footer via code and theme editor, it is ...
AUSBAU's user avatar
  • 1
6 votes
1 answer
528 views

Is it possible to add Custom Dashboard Widgets to Custom Admin Menu Page?

TL;DR : In simple terms, I just want to add a Dashboard Widget created by our plugin using wp_add_dashboard_widget function, to a custom Admin Menu Page created by the same plugin using add_menu_page ...
Ranuka's user avatar
  • 1,782
0 votes
0 answers
241 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 ...
Bhargav Joshi's user avatar
0 votes
1 answer
126 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 ...
Lewis's user avatar
  • 358
0 votes
1 answer
451 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() { ...
Sigurd Mazanti's user avatar
0 votes
1 answer
27 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 ...
EdA's user avatar
  • 103
0 votes
1 answer
195 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 ...
Vitor Rodrigues's user avatar
-1 votes
1 answer
37 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?
Roman Mikhol's user avatar
0 votes
1 answer
190 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 ...
Leo's user avatar
  • 1
1 vote
0 answers
184 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 ...
Bauwb's user avatar
  • 11
0 votes
2 answers
301 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(...
sariDon's user avatar
  • 255
1 vote
0 answers
113 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 ...
Avijit Palit's user avatar
1 vote
0 answers
127 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: // ...
Ben Foster's user avatar
0 votes
0 answers
48 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 ...
trunks's user avatar
  • 13
0 votes
2 answers
597 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( ...
trunks's user avatar
  • 13
0 votes
1 answer
45 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 ...
Ahmad Ali's user avatar
  • 121
0 votes
1 answer
525 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 ...
Greeso's user avatar
  • 2,116
0 votes
1 answer
220 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 ...
Schalk Joubert's user avatar
3 votes
4 answers
11k 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 ...
yannibmbr's user avatar
0 votes
1 answer
341 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 ...
Toniq's user avatar
  • 437
1 vote
1 answer
2k 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() { $...
Eli's user avatar
  • 69
0 votes
1 answer
194 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 ...
Melinsuna's user avatar
  • 113
2 votes
1 answer
293 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, '...
Срђан Станишић's user avatar
1 vote
0 answers
51 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 ...
Kefka's user avatar
  • 13
0 votes
1 answer
231 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 ...
Mohammad Shahnewaz Sarker's user avatar
1 vote
1 answer
69 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' =>...
John Doe's user avatar
  • 287
1 vote
1 answer
8k 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 ...
User95's user avatar
  • 35
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 ...
Moshe's user avatar
  • 121
2 votes
1 answer
6k 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, ...
Kenny Wyland's user avatar
0 votes
1 answer
584 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( ...
lord_linus's user avatar
0 votes
2 answers
1k 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 ...
assistbss's user avatar
  • 153
0 votes
0 answers
67 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.
user140169's user avatar
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('...
Ibrahim Al Khalil's user avatar
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)...
mrtnmgs's user avatar
  • 137
0 votes
1 answer
614 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 ...
NateShumate's user avatar
0 votes
1 answer
44 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 ...
Zack R's user avatar
  • 1
0 votes
1 answer
489 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? ...
Michael Lynch's user avatar
0 votes
1 answer
716 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 ...
Satrughna's user avatar
4 votes
1 answer
2k 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, ...
TorryVic's user avatar
  • 153
2 votes
3 answers
2k 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 ...
Greeso's user avatar
  • 2,116
1 vote
1 answer
504 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 ...
mrdenny's user avatar
  • 197
0 votes
0 answers
33 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. ...
kelvin's user avatar
  • 3
1 vote
3 answers
5k 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 ...
Cerere's user avatar
  • 231
1 vote
2 answers
230 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 ...
Amine Faiz's user avatar
0 votes
3 answers
691 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 ...
Andrea Somovigo's user avatar
1 vote
1 answer
484 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( __( '...
Jay's user avatar
  • 111