textdomain = pls_get_textdomain(); $widget_options = array( 'classname' => 'pls-quick-search', 'description' => esc_html__( 'Displays search filters for bedrooms, bathrooms, city, state, zip, minimum price, and maximum price', $this->textdomain ) ); /* Create the widget. */ parent::__construct( "pls-quick-search", esc_attr__( 'Listings Quick Search Widget', $this->textdomain ), $widget_options ); } function widget($args, $instance) { list($args, $instance) = self::process_defaults($args, $instance); extract( $args, EXTR_SKIP ); $title = apply_filters('widget_title', empty($instance['title']) ? ' ' : $instance['title']); $search_form_filter_string = ''; $search_form_filter_string .= 'context=' . apply_filters('pls_widget_quick_search_context', 'quick_search_widget'); $search_form_filter_string .= apply_filters('pls_widget_quick_search_filter_string', '&ajax=0'); echo $before_widget; echo "

" . $title . "

"; echo PLS_Partials::get_listings_search_form($search_form_filter_string); echo "
"; echo $after_widget; } function update($new_instance, $old_instance){ $instance = $old_instance; $instance['title'] = strip_tags(stripslashes($new_instance['title'])); return $instance; } function form($instance){ //Defaults $instance = wp_parse_args( (array) $instance, array('title'=>'') ); $title = htmlspecialchars($instance['title']); // Output the options echo '

'; } function process_defaults ($args, $instance) { /** Define the default argument array. */ $arg_defaults = array( 'title' => 'Have any questions?', 'before_title' => '

', 'after_title' => '

', 'before_widget' => '', 'widget_id' => '' ); /** Merge the arguments with the defaults. */ $args = wp_parse_args( $args, $arg_defaults ); /** Define the default argument array. */ $instance_defaults = array( 'widget_id' => '' ); /** Merge the arguments with the defaults. */ $instance = wp_parse_args( $instance, $instance_defaults ); return array($args, $instance); } } //end of class