How to get data from option page [closed]

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

Not able to show the add_menu_page icon

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’ );

Highlighting admin submenu pages

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

How is a widget supposed to reference what is added to custom submenu or addmenu fields?

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

add_menu_page include a php page from theme directory

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 with no link

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