widget_cssclass = 'cm-728x90-advertisemen-widget'; $this->widget_description = esc_html__( 'Add your 728x90 Advertisement here', 'colormag' ); $this->widget_name = esc_html__( 'TG: 728x90 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 728x90 Images Here', 'colormag' ), ), '728x90_image_link' => array( 'type' => 'url', 'default' => '', 'label' => esc_html__( 'Advertisement Image Link ', 'colormag' ), ), '728x90_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['728x90_image_link'] ) ? $instance['728x90_image_link'] : ''; $image_url = isset( $instance['728x90_image_url'] ) ? $instance['728x90_image_url'] : ''; // For WPML plugin compatibility, register string. if ( function_exists( 'icl_register_string' ) ) { icl_register_string( 'ColorMag Pro', 'TG: 728x90 Image Link' . $this->id, $image_link ); icl_register_string( 'ColorMag Pro', 'TG: 728x90 Image URL' . $this->id, $image_url ); } // For WPML plugin compatibility, assign variable to converted string. if ( function_exists( 'icl_t' ) ) { $image_link = icl_t( 'ColorMag Pro', 'TG: 728x90 Image Link' . $this->id, $image_link ); $image_url = icl_t( 'ColorMag Pro', 'TG: 728x90 Image URL' . $this->id, $image_url ); } $this->widget_start( $args ); ?> '; echo $output; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped } ?> widget_end( $args ); } }