'search_taxonomy'] : 'category'; $args = apply_filters( 'jet-search/search-suggestions/categories-select/args', array( 'id' => 'jet_search_suggestions_categories_' . $this->get_id(), 'name' => 'jet_search_suggestions_categories', 'class' => 'jet-search-suggestions__categories-select', 'echo' => 0, 'show_option_all' => $placeholder, 'hierarchical' => 1, 'hide_if_empty' => true, 'taxonomy' => $taxonomy, 'orderby' => 'name', ) ); $categories_list = wp_dropdown_categories( $args ); if ( is_wp_error( $categories_list ) || empty( $categories_list ) ) { return ''; } $categories_list = str_replace( 'name=\'jet_search_suggestions_categories\'', 'name="jet_search_suggestions_categories" data-placeholder="' . $placeholder . '"' , $categories_list ); return sprintf( $select_wrapper_html, $categories_list, $select_icon_html ); } /** * Set current query arguments. * * @param array $args */ public function set_current_query_args( &$args ) { $is_current_query = $this->get_settings( 'current_query' ); if ( filter_var( $is_current_query, FILTER_VALIDATE_BOOLEAN ) ) { $current_query = $this->get_current_query_args(); if ( ! empty( $current_query ) ) { $args['current_query'] = $current_query; } } } /** * Get current query arguments. * * @return array */ public function get_current_query_args() { if ( null === $this->current_query ) { global $wp_query; $this->current_query = $wp_query->query; if ( class_exists( 'WooCommerce' ) ) { if ( is_shop() || is_product_taxonomy() || is_post_type_archive( 'product' ) ) { $this->current_query['post_type'] = 'product'; } } } return $this->current_query; } }