Questions tagged [add-menu-page]

Add a top level menu page.

Filter by
Sorted by
Tagged with
5
votes
2answers
11k views

Add custom page link with anchor

In my admin section I would like to add in Appearance > Menus > some custom pages to add to my menu. I have two different menu one for the home page and one for the others pages. In my home page menu ...
3
votes
1answer
6k views

Generate Advanced Custom Fields box in custom admin menu page

I have created an custom admin menu page called FCC Youtube with add_menu_page function which has some custom fields I manually generated via HTML and PHP: code ( just the part how I created this ...
0
votes
2answers
514 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
vote
1answer
625 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
2answers
1k 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 ...
0
votes
1answer
1k 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
23 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() { $...
1
vote
1answer
508 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 ...
0
votes
1answer
20 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 ...
0
votes
1answer
58 views

Cloning admin pages like users.php

In my project I want to make a new menu position which will be actually a copy of 'Users' page but with some additional filters/modifications. For example as a result I need to have another menu ...
2
votes
1answer
45 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
34 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
118 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
29 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' =>...
0
votes
0answers
168 views

Max Mega Menu - Change it to alphabetical order

I have a max mega menu plugin on my website. I would like a single dropdown, with 5 columns. I would like to put the menus in alphabetical order, underneath each other, but when i try to move them, ...
1
vote
1answer
1k 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
36 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 ...
1
vote
1answer
1k 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
158 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
121 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 ...
5
votes
2answers
16k views

Show Custom Taxonomy Inside Custom Menu

I have a custom menu using add_menu_page: add_menu_page('My menu' , 'Some text', 'read', 'nwcm'); Under it, I show a custom post type menu item; // Create the news custom post type ...
0
votes
0answers
23 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
968 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
3answers
318 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 ...
0
votes
1answer
1k 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
94 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 ...
2
votes
5answers
2k views

How to prevent parent admin page from appearring as a child admin page

I am using this code: add_menu_page($page_title, $menu_title, $this->capability, $menu_slug, $function); Which is adding top level admin page. When I add: add_submenu_page( $menu_slug, 'sub menu ...
0
votes
1answer
20 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 ...
3
votes
3answers
9k views

How to use a WordPress' existing admin icon?

I use the add_menu_page function to add an new admin menu: add_menu_page( 'Custom_menu', 'Custom_menu', 'edit_posts', 'custom_slug', '', 'wordpress_existing_icon', 5 ); ...
5
votes
2answers
7k views

add_menu_page permissions - what am I doing wrong?

I am running a fresh install of Wordpress 3.3.2 and the only plugin enabled is one I'm developing, but I can't seem to get past a permissions issue in add_menu_page. With the exception of using ...
0
votes
1answer
116 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? ...
1
vote
2answers
340 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 ...
0
votes
1answer
307 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
802 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, ...
2
votes
2answers
2k 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'));...
3
votes
2answers
10k views

add_submenu_page not working

I have a built a plugin which creates a custom menu like this: add_menu_page( 'Wholesale Pricing', 'Wholesale', 'manage_options', 'woo-wholesale', 'woo_wholesale_page_call'); I am now trying to ...
0
votes
1answer
257 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
26 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. ...
81
votes
3answers
63k views

add_menu_page() with different name for first submenu item

The add_menu_page documentation says to pass the menu title as the second parameter: add_menu_page('Page Title', 'Menu Title', ...); When adding more pages later via add_submenu_page, the main page ...
1
vote
2answers
112 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 ...
1
vote
1answer
237 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
79 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
40 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
540 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.
1
vote
2answers
1k views

Add_menu_page() error message -> “You do not have sufficient permissions to access this page”

I'm currently building a website for a friend and have assigned him the user role of editor. I don't want to give him an administrator role in case he breaks the layout. Anyway, I am using '...
2
votes
0answers
489 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

add_menu_page include a php page from theme directory

I have added some custom tables to a wordpress and trying to add wp-admin section to manage them. By using following code I have successfully added a menu item in wp-admin but I'm unable to call the ...
1
vote
1answer
115 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
173 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
69 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 ...