'agency_ecommerce_widget_advertisement', 'description' => esc_html__( 'Widget to display advertisement. Recommended to use in Advertisement Below Slider area', 'agency-ecommerce' ), ); parent::__construct( 'agency-ecommerce-advertisement', esc_html__( 'AE: Advertisement', 'agency-ecommerce' ), $opts ); } /** * 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 ) { $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base ); $sub_title = ! empty( $instance['sub_title'] ) ? esc_html( $instance['sub_title'] ) : ''; $offer_percent = ! empty( $instance['offer_percent'] ) ? esc_html( $instance['offer_percent'] ) : ''; $offer_text = ! empty( $instance['offer_text'] ) ? esc_html( $instance['offer_text'] ) : ''; $button_text = ! empty( $instance['button_text'] ) ? esc_html( $instance['button_text'] ) : ''; $button_url = ! empty( $instance['button_url'] ) ? esc_url( $instance['button_url'] ) : ''; $content_position = !empty( $instance['content_position'] ) ? $instance['content_position'] : ''; $content_style = !empty( $instance['content_style'] ) ? $instance['content_style'] : ''; $bg_pic = ! empty( $instance['bg_pic'] ) ? esc_url( $instance['bg_pic'] ) : ''; $disable_overlay = ! empty( $instance['disable_overlay'] ) ? $instance['disable_overlay'] : 0; echo $args['before_widget']; //For content position if( 'right' === $content_position ){ $content_class = 'content-right-aligned'; }else{ $content_class = 'content-left-aligned'; } //For content styles if( 'style-2' === $content_style ){ $content_style = 'content-style-two'; }else{ $content_style = 'content-style-one'; } //For overlay position if( 1 === $disable_overlay ){ $overlay_class = 'overlay-disabled'; }else{ $overlay_class = 'overlay-enabled'; } ?>