isset( $atts['template'] ) ? sanitize_text_field( $atts['template'] ) : 'horizontal', 'search_page_id' => $page_settings['search'], 'has_keyword' => isset( $atts['keyword'] ) ? (int) $atts['keyword'] : 1, 'has_category' => isset( $atts['category'] ) ? (int) $atts['category'] : 0, 'has_tag' => isset( $atts['tag'] ) ? (int) $atts['tag'] : 0 ); if ( ! empty( $atts ) ) { $attributes = array_merge( $atts, $attributes ); } if ( ! $attributes['has_category'] && ! $attributes['has_tag'] ) { $attributes['template'] = 'compact'; } // Enqueue dependencies wp_enqueue_style( AIOVG_PLUGIN_SLUG . '-public' ); if ( $attributes['has_tag'] ) { wp_enqueue_script( AIOVG_PLUGIN_SLUG . '-autocomplete' ); } // Process output ob_start(); include apply_filters( 'aiovg_load_template', AIOVG_PLUGIN_DIR . 'public/templates/search-form-template-' . sanitize_file_name( $attributes['template'] ) . '.php' ); return ob_get_clean(); } }