esc_html__( 'Displays Advertisements', 'Divi' ) ); $control_ops = array('width' => 400, 'height' => 500); parent::__construct( false, $name = esc_html__( 'ET Advertisement', 'Divi' ), $widget_ops, $control_ops ); } /* Displays the Widget in the front-end */ function widget($args, $instance){ extract($args); $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? esc_html__( 'Advertisement', 'Divi' ) : esc_html( $instance['title'] ) ); $use_relpath = isset($instance['use_relpath']) ? $instance['use_relpath'] : false; $new_window = isset($instance['new_window']) ? $instance['new_window'] : false; $bannerPath[1] = empty($instance['bannerOnePath']) ? '' : esc_attr($instance['bannerOnePath']); $bannerUrl[1] = empty($instance['bannerOneUrl']) ? '' : esc_url($instance['bannerOneUrl']); $bannerTitle[1] = empty($instance['bannerOneTitle']) ? '' : esc_attr($instance['bannerOneTitle']); $bannerAlt[1] = empty($instance['bannerOneAlt']) ? '' : esc_attr($instance['bannerOneAlt']); $bannerPath[2] = empty($instance['bannerTwoPath']) ? '' : esc_attr($instance['bannerTwoPath']); $bannerUrl[2] = empty($instance['bannerTwoUrl']) ? '' : esc_url($instance['bannerTwoUrl']); $bannerTitle[2] = empty($instance['bannerTwoTitle']) ? '' : esc_attr($instance['bannerTwoTitle']); $bannerAlt[2] = empty($instance['bannerTwoAlt']) ? '' : esc_attr($instance['bannerTwoAlt']); $bannerPath[3] = empty($instance['bannerThreePath']) ? '' : esc_attr($instance['bannerThreePath']); $bannerUrl[3] = empty($instance['bannerThreeUrl']) ? '' : esc_url($instance['bannerThreeUrl']); $bannerTitle[3] = empty($instance['bannerThreeTitle']) ? '' : esc_attr($instance['bannerThreeTitle']); $bannerAlt[3] = empty($instance['bannerThreeAlt']) ? '' : esc_attr($instance['bannerThreeAlt']); $bannerPath[4] = empty($instance['bannerFourPath']) ? '' : esc_attr($instance['bannerFourPath']); $bannerUrl[4] = empty($instance['bannerFourUrl']) ? '' : esc_url($instance['bannerFourUrl']); $bannerTitle[4] = empty($instance['bannerFourTitle']) ? '' : esc_attr($instance['bannerFourTitle']); $bannerAlt[4] = empty($instance['bannerFourAlt']) ? '' : esc_attr($instance['bannerFourAlt']); $bannerPath[5] = empty($instance['bannerFivePath']) ? '' : esc_attr($instance['bannerFivePath']); $bannerUrl[5] = empty($instance['bannerFiveUrl']) ? '' : esc_url($instance['bannerFiveUrl']); $bannerTitle[5] = empty($instance['bannerFiveTitle']) ? '' : esc_attr($instance['bannerFiveTitle']); $bannerAlt[5] = empty($instance['bannerFiveAlt']) ? '' : esc_attr($instance['bannerFiveAlt']); $bannerPath[6] = empty($instance['bannerSixPath']) ? '' : esc_attr($instance['bannerSixPath']); $bannerUrl[6] = empty($instance['bannerSixUrl']) ? '' : esc_url($instance['bannerSixUrl']); $bannerTitle[6] = empty($instance['bannerSixTitle']) ? '' : esc_attr($instance['bannerSixTitle']); $bannerAlt[6] = empty($instance['bannerSixAlt']) ? '' : esc_attr($instance['bannerSixAlt']); $bannerPath[7] = empty($instance['bannerSevenPath']) ? '' : esc_attr($instance['bannerSevenPath']); $bannerUrl[7] = empty($instance['bannerSevenUrl']) ? '' : esc_url($instance['bannerSevenUrl']); $bannerTitle[7] = empty($instance['bannerSevenTitle']) ? '' : esc_attr($instance['bannerSevenTitle']); $bannerAlt[7] = empty($instance['bannerSevenAlt']) ? '' : esc_attr($instance['bannerSevenAlt']); $bannerPath[8] = empty($instance['bannerEightPath']) ? '' : esc_attr($instance['bannerEightPath']); $bannerUrl[8] = empty($instance['bannerEightUrl']) ? '' : esc_url($instance['bannerEightUrl']); $bannerTitle[8] = empty($instance['bannerEightTitle']) ? '' : esc_attr($instance['bannerEightTitle']); $bannerAlt[8] = empty($instance['bannerEightAlt']) ? '' : esc_attr($instance['bannerEightAlt']); echo $before_widget; if ( $title ) echo $before_title . $title . $after_title; ?>
'') { ?> >" alt="" title="" />
__( 'Advertisement', 'Divi' ), 'use_relpath' => false, 'new_window' => true, 'bannerOnePath'=>'', 'bannerOneUrl'=>'', 'bannerOneTitle'=>'', 'bannerOneAlt'=>'', 'bannerTwoPath'=>'', 'bannerTwoUrl'=>'', 'bannerTwoTitle'=>'', 'bannerTwoAlt'=>'','bannerThreePath'=>'', 'bannerThreeUrl'=>'','bannerThreeTitle'=>'', 'bannerThreeAlt'=>'','bannerFourPath'=>'', 'bannerFourUrl'=>'','bannerFourTitle'=>'', 'bannerFourAlt'=>'','bannerFivePath'=>'', 'bannerFiveUrl'=>'','bannerFiveTitle'=>'', 'bannerFiveAlt'=>'','bannerSixPath'=>'', 'bannerSixUrl'=>'','bannerSixTitle'=>'','bannerSixAlt'=>'', 'bannerSevenPath'=>'', 'bannerSevenUrl'=>'','bannerSevenTitle'=>'','bannerSevenAlt'=>'','bannerEightPath'=>'', 'bannerEightUrl'=>'','bannerEightTitle'=>'','bannerEightAlt'=>'') ); $title = esc_html($instance['title']); $bannerPath[1] = esc_attr($instance['bannerOnePath']); $bannerUrl[1] = esc_url($instance['bannerOneUrl']); $bannerTitle[1] = esc_attr($instance['bannerOneTitle']); $bannerAlt[1] = esc_attr($instance['bannerOneAlt']); $bannerPath[2] = esc_attr($instance['bannerTwoPath']); $bannerUrl[2] = esc_url($instance['bannerTwoUrl']); $bannerTitle[2] = esc_attr($instance['bannerTwoTitle']); $bannerAlt[2] = esc_attr($instance['bannerTwoAlt']); $bannerPath[3] = esc_attr($instance['bannerThreePath']); $bannerUrl[3] = esc_url($instance['bannerThreeUrl']); $bannerTitle[3] = esc_attr($instance['bannerThreeTitle']); $bannerAlt[3] = esc_attr($instance['bannerThreeAlt']); $bannerPath[4] = esc_attr($instance['bannerFourPath']); $bannerUrl[4] = esc_url($instance['bannerFourUrl']); $bannerTitle[4] = esc_attr($instance['bannerFourTitle']); $bannerAlt[4] = esc_attr($instance['bannerFourAlt']); $bannerPath[5] = esc_attr($instance['bannerFivePath']); $bannerUrl[5] = esc_url($instance['bannerFiveUrl']); $bannerTitle[5] = esc_attr($instance['bannerFiveTitle']); $bannerAlt[5] = esc_attr($instance['bannerFiveAlt']); $bannerPath[6] = esc_attr($instance['bannerSixPath']); $bannerUrl[6] = esc_url($instance['bannerSixUrl']); $bannerTitle[6] = esc_attr($instance['bannerSixTitle']); $bannerAlt[6] = esc_attr($instance['bannerSixAlt']); $bannerPath[7] = esc_attr($instance['bannerSevenPath']); $bannerUrl[7] = esc_url($instance['bannerSevenUrl']); $bannerTitle[7] = esc_attr($instance['bannerSevenTitle']); $bannerAlt[7] = esc_attr($instance['bannerSevenAlt']); $bannerPath[8] = esc_attr($instance['bannerEightPath']); $bannerUrl[8] = esc_url($instance['bannerEightUrl']); $bannerTitle[8] = esc_attr($instance['bannerEightTitle']); $bannerAlt[8] = esc_attr($instance['bannerEightAlt']); # Title echo '

'; ?> id="get_field_id('use_relpath'); ?>" name="get_field_name('use_relpath'); ?>" />
id="get_field_id('new_window'); ?>" name="get_field_name('new_window'); ?>" />

'; # Banner #1 Url echo '

'; # Banner #1 Title echo '

'; # Banner #1 Alt echo '

'; # Banner #2 Image echo '

'; # Banner #2 Url echo '

'; # Banner #2 Title echo '

'; # Banner #2 Alt echo '

'; # Banner #3 Image echo '

'; # Banner #3 Url echo '

'; # Banner #3 Title echo '

'; # Banner #3 Alt echo '

'; # Banner #4 Image echo '

'; # Banner #4 Url echo '

'; # Banner #4 Title echo '

'; # Banner #4 Alt echo '

'; # Banner #5 Image echo '

'; # Banner #5 Url echo '

'; # Banner #5 Title echo '

'; # Banner #5 Alt echo '

'; # Banner #6 Image echo '

'; # Banner #6 Url echo '

'; # Banner #6 Title echo '

'; # Banner #6 Alt echo '

'; # Banner #7 Image echo '

'; # Banner #7 Url echo '

'; # Banner #7 Title echo '

'; # Banner #7 Alt echo '

'; # Banner #8 Image echo '

'; # Banner #8 Url echo '

'; # Banner #8 Title echo '

'; # Banner #8 Alt echo '

'; echo '

' . esc_html__( "If you don't want to display some banners - leave approptiate fields blank", 'Divi' ) . '.

'; } }// end AdvWidget class function AdvWidgetInit() { register_widget('AdvWidget'); } add_action('widgets_init', 'AdvWidgetInit');