$menu_item) { if ($menu_item[2] === 'edit.php?post_type=primekitlibrary') { $current_file = basename($_SERVER['PHP_SELF']); if ($current_file === 'post-new.php' && isset($_GET['post_type']) === 'primekitlibrary') { // Highlight the new submenu as active when adding a new post $submenu['abcbiz_home'][$key][4] = 'current'; } elseif ($current_file === 'edit.php' && isset($_GET['post_type']) && $_GET['post_type'] === 'primekitlibrary') { // Highlight the new submenu as active when on the edit posts screen $submenu['abcbiz_home'][$key][4] = 'current'; } } } } } }