The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [add-menu-page]

Add a top level menu page.

Filter by
Sorted by
Tagged with
1
vote
1answer
29 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
22 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
53 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
38 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
139 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
30 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
2k 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
2k 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
182 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
157 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
24 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
1k 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
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
109 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
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 ...
0
votes
1answer
129 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
324 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
855 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
412 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
294 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. ...
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 ...
1
vote
2answers
117 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
347 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
252 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
764 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
504 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
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
118 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
187 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
71 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
549 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 ...
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'));...
0
votes
1answer
214 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 ...
1
vote
0answers
156 views

Dynamic admin submenu

I'm creating a plugin for WordPress with dynamic sub-menu's fetched from the server. Putting the dynamic loading of sub-menu's into the menu_setup() hook function would slow down other WordPress ...
0
votes
2answers
546 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 ...
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 ...
4
votes
1answer
861 views

What is the use of $page_title and how to use it?

I'm developing a WordPress plugin and added add_menu_page() but not sure what is the use of first parameter $page_title. If this is to use to display page title on the plugin page then how can I do ...
5
votes
2answers
12k 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 ...
0
votes
1answer
249 views

Add a page in admin without adding menu item

In my plugin I have registered a menu_page; now I need another page. How can I add another page to my plugin without adding another menu item? Is it possible to call it by href?
0
votes
1answer
147 views

Plugin page and capabilities

i´am developing my own WP plugin with custom functions and i would like to show the new submenu in the standard admin panel for everyone, who logs in. My code: $capa = 'administrator' or 'author' or '...
2
votes
1answer
4k views

Theme Options page not showing up in admin menu

I'm currently developing a WordPress theme and would like it to have a preferences pane in order to specify the user's Google Analytics tracking code for example. Following the instructions I got on ...
0
votes
2answers
1k views

add_menu_page with no link

I wanted to create an admin menu in WordPress that does not go to a page when you click it. The Menu would be as follows. Members <-- Top Level View Members Add Members "Members", the top level ...
1
vote
1answer
644 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, $...
5
votes
2answers
17k 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 ...
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 '...
0
votes
1answer
530 views

Highlighting admin submenu pages

Here is my plugin's current menu/submenu structure: add_menu_page('Sunshine', 'Sunshine', 'sunshine_manage_options', 'sunshine_admin', 'sunshine_dashboard_display', plugins_url( 'assets/images/...