'primebulletin_featured_category_widget', 'description' => esc_html__('Displays categories and posts.', 'primebulletin'), 'customize_selective_refresh' => true, ); $fields = array( 'title_1' => array( 'label' => esc_html__('Title 1:', 'primebulletin'), 'type' => 'text', 'class' => 'widefat', ), 'post_category_1' => array( 'label' => esc_html__('Select Category 1:', 'primebulletin'), 'type' => 'dropdown-taxonomies', 'show_option_all' => esc_html__('All Categories', 'primebulletin'), ), 'title_2' => array( 'label' => esc_html__('Title 2:', 'primebulletin'), 'type' => 'text', 'class' => 'widefat', ), 'post_category_2' => array( 'label' => esc_html__('Select Category 2:', 'primebulletin'), 'type' => 'dropdown-taxonomies', 'show_option_all' => esc_html__('All Categories', 'primebulletin'), ), 'title_3' => array( 'label' => esc_html__('Title 3:', 'primebulletin'), 'type' => 'text', 'class' => 'widefat', ), 'post_category_3' => array( 'label' => esc_html__('Select Category 3:', 'primebulletin'), 'type' => 'dropdown-taxonomies', 'show_option_all' => esc_html__('All Categories', 'primebulletin'), ), 'column_number' => array( 'label' => esc_html__('Number of Column:', 'primebulletin'), 'type' => 'select', 'default' => '3', 'options' => array( '2' => esc_html__('2', 'primebulletin'), '3' => esc_html__('3', 'primebulletin'), ), ), ); parent::__construct('primebulletin-featured-category-layout', esc_html__('PrimeBulletin: Category Call to action Widget', 'primebulletin'), $opts, array(), $fields); } /** * Outputs the content for the current widget instance. * * @param array $args Display arguments. * @param array $instance Settings for the current widget instance. * @since 1.0.0 * */ function widget($args, $instance) { $params = $this->get_params($instance); echo $args['before_widget']; $column_number = isset($params['column_number']) ? $params['column_number'] : ''; if ($column_number == '2') { $column_class = 6; $bg_class = 'data-bg-big'; } else { $column_class = 4; $bg_class = 'data-bg-medium'; } ?>