usage of admin_url() in add_menu_page()
Reference: add submenu page You can not use any function as url parameter, only admin page slug.
Reference: add submenu page You can not use any function as url parameter, only admin page slug.
I echoed out this $google_map_api_key = get_option(‘talimi_mapapi’); and its working fine. try in functions.php add require_once get_template_directory() . ‘/page-templates/theme-settings.php’; or add wp-load.php in your file. if you are using multi-site then try <?php get_site_option( $option, $default , $use_cache ) ?> reference https://codex.wordpress.org/Function_Reference/get_site_option
You have added the directory name where do you have stored the icon and this should be the 6th argument rather than 5th. add_menu_page( ‘pms_rohitashv’, ‘PMS’, ‘subscriber’, ‘pms_rohitashv-main’, ”, plugin_dir_url( __FILE__ ).’/images/icon.png’ );
Try it: function sunshine_submenu_show_fix($parent_file) { global $plugin_page; $taxonomy = $current_screen->taxonomy; if ($taxonomy == ‘sunshine-product-category’) $plugin_page=”sunshine_admin”; return $parent_file; } add_action(‘parent_file’, ‘sunshine_submenu_show_fix’); explanation: in file /wp-admin/menu-header.php: $parent_file = apply_filters( ‘parent_file’, $parent_file ); get_admin_page_parent(); … function _wp_menu_output(…) { … if ( ( $parent_file && $item[2] == $parent_file ) || ( empty($typenow) && $self == $item[2] ) ) { … Read more
The setting API, which its usage is being demonstrated in that code is meant to be use as a framework to create settings pages which result in update of values in options. Widget settings are is a somewhat more abstract level. They are stored in options, but there is no flexibility how they are stored, … Read more
The error tells you what the problem is… PHP Warning: call_user_func_array() expects parameter 1 to be a valid callback, function … Your “callback” isn’t a function. It is a file. It doesn’t work that way. You will need a helper function to include a file. Something like: add_menu_page( ‘Private Messages’, ‘Private Messages’, ‘manage_options’, ‘message_admin’, ‘include_message_admin’, … Read more
add_menu_page the children get url encoded prefix
Auto add (multiple) Custom Post Types to menu
From the codex page: $menu_slug (string) (required) The slug name to refer to this menu by (should be unique for this menu). Prior to Version 3.0 this was called the file (or handle) parameter. If the function parameter is omitted, the menu_slug should be the PHP file that handles the display of the menu page … Read more
You can use add_menu_page() to add the link yourself. Simply use # as menu slug. You can then use add_submenu_page() to add the other menu items yourself. Another option would be to to fiddle with the global $menu array. Take this answer as base. Edit: As per the comments, there needs to a top & … Read more