add_submenu_page and class=”current” not working
-
Hi all,
I’m developing a plugin to manage some items (eg. Books with related Categories) in the Admin Panel. I added a Main Page (Books) in the menu and two Sub Pages (“Add Book” and “Book Categories”) and I get the pages without problem.
The only problem is that when I open the subpages “Add Book” and “Book Categories”, the link in the submenu does’n get the
class="current"
style. The style remains always on the Main Page “Books”.This is the code… any suggestions?
if (! function_exists('BK_TheMenu')){
function BK_TheMenu(){
$add_book_page = __FILE__ . "&action=ShowBooks";
$cat_book_page = __FILE__ . "&action=BookCategories";
add_menu_page('Books', 'Books', 8, __FILE__, 'BK_admin');
add_submenu_page(__FILE__, 'Add Book', 'Add Book', 8, $add_book_page, 'BK_admin');
add_submenu_page(__FILE__, 'Book Categories', 'Book Categories', 8, $cat_book_page, 'BK_admin');
}
}Thanks!
- The topic ‘add_submenu_page and class=”current” not working’ is closed to new replies.