edit-tags.php in plugin admin menu hides when is the active page

I’ve managed to solve this using Javascript to ‘open’ the menu item when on the edit tags page in the plugin. Relevant plugin PHP file $screen = get_current_screen(); // Check we’re only on the edit-tags page in the plugin if (‘edit-tags’ === $screen->base && ‘subscriber’ === $screen->post_type) { wp_enqueue_script( $this->plugin_slug . ‘-subscriber-edit-tags-script’, plugins_url(‘assets/js/subscriber-edit-tags.js’, __FILE__ ), … Read more

Add a Submenu from Another Submenu in a Custom Theme

It seems that you are adding the menu levels as separate menus: A “Primary menu” containing the items: “HOME”, “DPRK TOURS”, “INTERNATIONAL”, … etc. A “Secondary menu” containing the items: “INTERNATIONAL GROUP TOURS”, “VOLUNTEER PROGRAMS”, … etc. However, most themes support at most two such menu-levels, and some even support only one. So, if you … Read more

Redirect loop when forwarding to mobile site

You need to check that you aren’t already on the mobile site: function redirecting_to_mobile_site() { if ( $_SERVER[‘SERVER_NAME’] !== ‘m.example.com’ && wp_is_mobile() ) { wp_redirect( ‘http://m.example.com’ . $_SERVER[‘REQUEST_URI’], 301 ); exit; } } add_action( ‘template_redirect’, ‘redirecting_to_mobile_site’ ); You’ll need to clear your browser cache to properly test the fix.

Add Admin menus or submenus depending on conditions

I managed to find a solution: File 1: //Count the number of active plugins whose Author is “My Brand”, and store the number in a global variable. $GLOBALS[‘mybrand_active_plugins’]=0; if (!function_exists(‘get_plugins’)){require_once ABSPATH.’wp-admin/includes/plugin.php’;} $plugins=get_plugins(); $activated_plugins=get_option(‘active_plugins’); foreach ($activated_plugins as $p){ if( (isset($plugins[$p])) AND ($plugins[$p][‘Author’]==’My Brand’)){ $GLOBALS[‘mybrand_active_plugins’]++; } } // Add menus on sidebar if($GLOBALS[‘mybrand_active_plugins’]<2) { function sub1_setup_menu() { … Read more

Adding Meta Box to Specific Submenu Page

I think for this you want to go with WordPress Setting API. If you prefer meta box. You have to add a do_action in your function which render the page (view_tasks_submenu_page_callback). do_action( ‘add_meta_boxes’, $hook_id ); And add do_meta_boxes($hook_id, $context, null) where you want your meta boxes appear. replace $hook_id by the fourth parameter of add_meta_box … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)