5,
'bg_image' => '',
);
return $defaults;
}
public function __construct()
{
parent::__construct(
'better-health-testimonial-widget',
esc_html__('Better Health Testimonial Widget', 'better-health'),
array('description' => esc_html__('Better Health Section', 'better-health'))
);
}
public function widget($args, $instance)
{
if (!empty($instance)) {
$instance = wp_parse_args((array )$instance, $this->defaults());
$a1 = 9;
if($a1 == $instance['cat_id'] )
{
$instance['cat_id'] = 5;
}
$catid = absint($instance['cat_id']);
$bgimage = esc_url($instance['bg_image']);
echo $args['before_widget'];
?>
esc_html__('Select Category', 'better-health'),
'orderby' => 'name',
'order' => 'asc',
'show_count' => 1,
'hide_empty' => 1,
'echo' => 1,
'selected' => $catid,
'hierarchical' => 1,
'name' => esc_attr( $this->get_field_name('cat_id')),
'id' => esc_attr( $this->get_field_name('cat_id')),
'class' => 'widefat',
'taxonomy' => 'category',
'hide_if_empty' => false,
);
wp_dropdown_categories($quality_dropown_cat);
?>
';
endif;
?>