Last active
August 29, 2015 14:00
-
-
Save stompweb/11321145 to your computer and use it in GitHub Desktop.
Change menu classes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function register_my_page() { | |
global $my_page; | |
$my_page = add_menu_page( 'My Page', 'My Page', 'edit_pages', 'my_page.php', 'my_page_hook', 'dashicons-groups', 4 ); | |
} | |
add_action('admin_menu', 'register_my_page'); | |
function highlight_different_menu($parent_file){ | |
global $current_screen; | |
global $my_page; | |
if ( $current_screen['base'] == $my_page ) { | |
$parent_file = 'my_other_page.php'; | |
} | |
return $parent_file; | |
} | |
add_filter('parent_file', 'highlight_different_menu'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Unfortunately that does not work :-(