esc_html__( 'An input that searches WooCommerce products using an autocomplete feature', 'ajax-product-search-woocommerce' ), ) // Args ); } /** * Front-end display of widget. * * @see WP_Widget::widget() * @version 1.0.9 * @since 1.0.0 * * @param array $args Widget arguments. * @param array $instance Saved values from database. */ public function widget( $args, $instance ) { echo $args['before_widget']; if ( ! empty( $instance['title'] ) ) { echo $args['before_title'] . apply_filters( 'widget_title', $instance['title'] ) . $args['after_title']; } $placeholder = ! empty( $instance['placeholder'] ) ? esc_html( sanitize_text_field( $instance['placeholder'] ) ) : sanitize_text_field( get_option( Alg_WC_APS_Settings_Texts::OPTION_PLACEHOLDER, __( 'Search products', 'ajax-product-search-woocommerce' ) ) ); $input = do_shortcode( "[" . Alg_WC_APS_Product_Searcher_Shortcode_Manager::TAG_SEARCH_INPUT . " placeholder='{$placeholder}' ]" ); echo $input; echo $args['after_widget']; } /** * Back-end widget form. * * @see WP_Widget::form() * @version 1.0.0 * @since 1.0.0 * * @param array $instance Previously saved values from database. */ public function form( $instance ) { $title = ! empty( $instance['title'] ) ? $instance['title'] : ''; $placeholder = ! empty( $instance['placeholder'] ) ? $instance['placeholder'] : ''; ?>