'agency_ecommerce_widget_advertisement', 'description' => esc_html__('Widget to display advertisement.', 'agency-ecommerce'), ); parent::__construct('agency-ecommerce-advertisement', esc_html__('AE - Advertisement', 'agency-ecommerce'), $opts); } function widget_fields() { $fields = array( 'title_one' => array( 'name' => 'title_one', 'title' => esc_html__('Title One', 'agency-ecommerce'), 'type' => 'text', 'default' => esc_html__('Title One', 'agency-ecommerce'), ), 'background_image_one' => array( 'name' => 'background_image_one', 'title' => esc_html__('Image One', 'agency-ecommerce'), 'type' => 'image', ), 'link_one' => array( 'name' => 'link_one', 'title' => esc_html__('Link One', 'agency-ecommerce'), 'type' => 'text', ), 'title_two' => array( 'name' => 'title_two', 'title' => esc_html__('Title Two', 'agency-ecommerce'), 'type' => 'text', 'default' => esc_html__('Title Two', 'agency-ecommerce'), ), 'background_image_two' => array( 'name' => 'background_image_two', 'title' => esc_html__('Image Two', 'agency-ecommerce'), 'type' => 'image', ), 'link_two' => array( 'name' => 'link_two', 'title' => esc_html__('Link Two', 'agency-ecommerce'), 'type' => 'text', ), 'title_three' => array( 'name' => 'title_three', 'title' => esc_html__('Title Three', 'agency-ecommerce'), 'type' => 'text', 'default' => esc_html__('Title Three', 'agency-ecommerce'), ), 'background_image_three' => array( 'name' => 'background_image_three', 'title' => esc_html__('Image Three', 'agency-ecommerce'), 'type' => 'image', ), 'link_three' => array( 'name' => 'link_three', 'title' => esc_html__('Link Three', 'agency-ecommerce'), 'type' => 'text', ) ); return $fields; } /** * Echo the widget content. * * @since 1.0.0 * * @param array $args Display arguments including before_title, after_title, * before_widget, and after_widget. * @param array $instance The settings for the particular instance of the widget. */ function widget($args, $instance) { $valid_widget_instance = Agency_Ecommerce_Widget_Validation::instance()->validate($instance, $this->widget_fields()); echo $args['before_widget']; ?>