AnsPress_Hooks::fix_nav_current_class( array $class, object $item )
Description #
Add current-menu-item class in AnsPress pages
Parameters #
- $classarray (Required) Menu class.
- $itemobject (Required) Current menu item.
Source #
File: includes/hooks.php
public static function fix_nav_current_class( $class, $item ) { // Return if empty or `$item` is not object. if ( empty( $item ) || ! is_object( $item ) ) { return $class; } if ( ap_current_page() === $item->object ) { $class[] = 'current-menu-item'; } return $class; }
Expand full source code Collapse full source code View on GitHub: includes/hooks.php:541
Add your comment