lib/Post_Type_Page.php
public function filter_wp_nav_menu_objects( $menu_items ) {
		foreach ( $menu_items as &$item ) {
			if ( 'page' !== $item->object || (int) $item->object_id !== $this->post_id ) {
				continue;
			}

			if ( is_singular( $this->post_type ) ) {
				$item->current_item_parent = true;
				$item->classes[]           = 'current-menu-parent';

				$menu_items = \Types\menu_items_ancestors( $item, $menu_items );
			}

			if ( is_post_type_archive( $this->post_type ) ) {
				$item->classes[] = 'current-menu-item';
				$item->current   = true;

				$menu_items = \Types\menu_items_ancestors( $item, $menu_items );
			}
		}

		return $menu_items;
	}
public function filter_wp_nav_menu_objects( $menu_items ) {
		foreach ( $menu_items as &$item ) {
			if ( 'page' !== $item->object || (int) $item->object_id !== $this->post_id ) {
				continue;
			}

			if ( is_singular( $this->post_type ) ) {
				$item->current_item_parent = true;
				$item->classes[]           = 'current-menu-parent';

				$menu_items = \Types\menu_items_ancestors( $item, $menu_items );
			}

			if ( is_post_type_archive( $this->post_type ) ) {
				$item->classes[] = 'current-menu-item';
				$item->current   = true;

				$menu_items = \Types\menu_items_ancestors( $item, $menu_items );
			}
		}

		return $menu_items;
	}
public function filter_wp_nav_menu_objects ( $ menu_items ) { foreach ( $ menu_items as & $ item ) { if ( 'page' !== $ item -> object || ( int ) $ item -> object_id !== $ this -> post_id ) { continue ; } if ( is_singular ( $ this -> post_type ) ) { $ item -> current_item_parent = true ; $ item -> classes [ ] = 'current-menu-parent' ; $ menu_items = \ Types \ menu_items_ancestors ( $ item , $ menu_items ) ; } if ( is_post_type_archive ( $ this -> post_type ) ) { $ item -> classes [ ] = 'current-menu-item' ; $ item -> current = true ; $ menu_items = \ Types \ menu_items_ancestors ( $ item , $ menu_items ) ; } } return $ menu_items ; }
Make sure menu items for our pages get the correct classes assigned

@param array $menu_items Array of menu items.

@return array
Make sure menu items for our pages get the correct classes assigned