esc_html__('This Widget show Users Feedback', 'buzstores') ) ); } /** * Helper function that holds widget fields * Array is used in update and form functions */ private function widget_fields() { $buzstores_cat_list = esc_attr(buzstores_Category_list()); $fields = array( 'testimonial_title' => array( 'buzstores_widgets_name' => 'testimonial_title', 'buzstores_widgets_title' => esc_html__('Title', 'buzstores'), 'buzstores_widgets_field_type' => 'text', ), 'testimonial_category' => array( 'buzstores_widgets_name' => 'testimonial_category', 'buzstores_widgets_title' => esc_html__('Testimonial Category', 'buzstores'), 'buzstores_widgets_field_type' => 'select', 'buzstores_widgets_field_options' => $buzstores_cat_list, ), ); return $fields; } /** * Front-end display of widget. * * @see WP_Widget::widget() * * @param array $args Widget arguments. * @param array $instance Saved values from database. */ public function widget($args, $instance) { extract($args); $title_widget = apply_filters( 'widget_title', empty( $instance['testimonial_title'] ) ? '' : $instance['testimonial_title'], $instance, $this->id_base ); $testimonial_category = isset( $instance['testimonial_category'] ) ? $instance['testimonial_category'] : '' ; echo $before_widget; ?>