esc_html__( 'Primary', 'pressbook' ), 'menu-2' => esc_html__( 'Top Menu', 'pressbook' ), 'social' => esc_html__( 'Social Links Menu', 'pressbook' ), ) ) ); } /** * Filter the HTML output of a nav menu item to add the dropdown button that reveal the sub-menu. * * @param string $item_output Nav menu item HTML. * @param object $item Nav menu item. * @param int $depth The depth of the menu. * @param array $args Array of menu args, such as theme location. * @return string Modified nav menu item HTML. */ public function add_dropdown_icons( $item_output, $item, $depth, $args ) { // Only add the sub-menu button to the main navigation. if ( 'menu-1' === $args->theme_location ) { // Skip if the item has no sub-menu. if ( in_array( 'menu-item-has-children', $item->classes, true ) ) { $item_output .= ''; } } return $item_output; } /** * Output HTML for the primary menu. */ public static function primary_menu() { if ( PrimaryNavbar::get_primary_navbar_search() ) { $search = ( '