Questions tagged [add-menu-page]

Add a top level menu page.

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

How can I have main menu item and first submenu both go to the custom post list? Using add_menu_page and add_submenu_page

I have a custom post type named slideshow. I'm using add_menu_page to add the main menu item, and add_submenu_page to add some submenu items. In the first call to add_submenu_page the slug property is ...
1
vote
0answers
11 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
2answers
29 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
0answers
14 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
0answers
15 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
0answers
7 views

How to go from add_submenu_page to another page

hello everyone i'm going from procedural php to objects, i was asking myself a question, once i created my plugin that gives me the possibility to have in the wp dashboard a quick view of a section ...
0
votes
0answers
41 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
2answers
98 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
1answer
33 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
1answer
176 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
1answer
20 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
3answers
8k 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
1answer
99 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
1answer
208 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
1answer
64 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
1answer
128 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
0answers
42 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
1answer
198 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
1answer
34 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
5k 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
0answers
42 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
1answer
4k 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
1answer
354 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
2answers
605 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
0answers
38 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
2answers
2k 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
2answers
2k 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
1answer
271 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
1answer
22 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
1answer
222 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
1answer
434 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
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, ...
1
vote
2answers
849 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
1answer
440 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
0answers
28 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
2answers
3k 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
2answers
148 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
3answers
486 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
1answer
327 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
1answer
98 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
0answers
41 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
1answer
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
0answers
527 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
1answer
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 ...
1
vote
1answer
129 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 ...
1
vote
0answers
267 views

Admin Dashboard with Custom Tab for Client

I am trying to create a basic Tour Date widget. When the user clicks on the Tour Date Tab from the admin dashboard I want them to be presented with five fields. Date Venue City, State or Country ...
0
votes
1answer
124 views

How to add a menu page for options in wordpress for user that has the role of vendor?

I want to add new options page ONLY for those users whose role is vendor. How can I do that? This is my current code. add_action('admin_menu', 'business_settings_menu'); function ...
1
vote
1answer
686 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 ...
3
votes
3answers
3k views

Adding an admin page - OOP approach not working

I have a parent class, which contains the following: use app\My_Dashboard; class My_Class { public function __construct() { add_action('admin_menu', array($this, 'setup_dashboard_page'));...
0
votes
1answer
231 views

Add Admin menus or submenus depending on conditions

I have two plugins in two different files that add a submenu (the plugin title) to the admin panel like this: Plugin 1: function myplugin1_setup_submenu(){ add_submenu_page("mybrand", "My ...