You appear to be a bot. Output may be restricted
Description
Find and combine the nav menu items to the main menu.
Usage
Genesis_AMP_Menu_Combiner::find_and_combine();
Parameters
Returns
void
Source
File name: genesis/lib/classes/class-genesis-amp-menu-combiner.php
Lines:
1 to 31 of 31
protected function find_and_combine() { foreach ( $this->menus_to_combine as $attribute ) { $nav_menu = $this->find_nav_ul( $attribute ); if ( ! $nav_menu ) { continue; } // Clone to avoid removing from current menu. $menu_items = $nav_menu->cloneNode( true ); // Combine the menu items with the main menu. // phpcs:disable WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase for ( $index = 0; $index < $menu_items->childNodes->length; $index++ ) { $menu_item = $menu_items->childNodes->item( $index ); // Skip if this is not an element node. if ( ! ( $menu_item instanceof DOMElement ) ) { continue; } // Set a class attribute to hide when viewport is larger than responsive width. $menu_item->setAttribute( 'class', 'genesis-amp-combined ' . $menu_item->getAttribute( 'class' ) ); $this->main_menu->appendChild( $menu_item ); } // phpcs:enable } }