widget_cssclass = 'widget_300x250_advertisement'; $this->widget_description = esc_html__( 'Add your 300x250 Advertisement here', 'colormag' ); $this->widget_name = esc_html__( 'TG: 300x250 Advertisement', 'colormag' ); $this->settings = array( 'title' => array( 'type' => 'text', 'default' => '', 'label' => esc_html__( 'Title:', 'colormag' ), ), 'image_addition_label' => array( 'type' => 'custom', 'default' => '', 'label' => esc_html__( 'Add your Advertisement 300x250 Images Here', 'colormag' ), ), '300x250_image_link' => array( 'type' => 'url', 'default' => '', 'label' => esc_html__( 'Advertisement Image Link ', 'colormag' ), ), '300x250_image_url' => array( 'type' => 'image', 'default' => '', 'label' => esc_html__( 'Advertisement Image ', 'colormag' ), ), ); parent::__construct(); } /** * Output widget. * * @see WP_Widget * * @param array $args Arguments. * @param array $instance Widget instance. */ public function widget( $args, $instance ) { $title = apply_filters( 'widget_title', isset( $instance['title'] ) ? $instance['title'] : '' ); $image_link = isset( $instance['300x250_image_link'] ) ? $instance['300x250_image_link'] : ''; $image_url = isset( $instance['300x250_image_url'] ) ? $instance['300x250_image_url'] : ''; $this->widget_start( $args ); ?> '; echo $output; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped } ?> widget_end( $args ); } }