'asterisk_lite_category_widget', 'description' => esc_html__('Displays selected category Image title.', 'asterisk-lite'), 'customize_selective_refresh' => true, ); $category_list = asterisk_lite_post_category_list(); $fields = array( 'title' => array( 'label' => esc_html__('Title:', 'asterisk-lite'), 'type' => 'text', 'class' => 'widefat', ), 'post_category_1' => array( 'label' => esc_html__('Select Category One:', 'asterisk-lite'), 'type' => 'select', 'options' => $category_list, ), 'post_category_2' => array( 'label' => esc_html__('Select Category Two:', 'asterisk-lite'), 'type' => 'select', 'options' => $category_list, ), 'post_category_3' => array( 'label' => esc_html__('Select Category Three:', 'asterisk-lite'), 'type' => 'select', 'options' => $category_list, ), 'post_category_4' => array( 'label' => esc_html__('Select Category Four:', 'asterisk-lite'), 'type' => 'select', 'options' => $category_list, ), 'post_category_5' => array( 'label' => esc_html__('Select Category Five:', 'asterisk-lite'), 'type' => 'select', 'options' => $category_list, ), 'post_category_6' => array( 'label' => esc_html__('Select Category Six:', 'asterisk-lite'), 'type' => 'select', 'options' => $category_list, ), 'post_category_7' => array( 'label' => esc_html__('Select Category Seven:', 'asterisk-lite'), 'type' => 'select', 'options' => $category_list, ), ); parent::__construct( 'asterisk-lite-category', esc_html__('Devs: Sidebar Category Widget', 'asterisk-lite'), $opts, array(), $fields ); } /** * Outputs the content for the current widget instance. * * @since 1.0.0 * * @param array $args Display arguments. * @param array $instance Settings for the current widget instance. */ function widget( $args, $instance ){ $params = $this->get_params( $instance ); echo $args['before_widget']; $title = isset( $params['title'] ) ? $params['title'] : ''; if( $title ){ echo $args['before_title'] . esc_html( $title ) . $args['after_title']; } ?>