__('Displays Advertisements', "business-elite")); $control_ops = array('width' => 400, 'height' => 500); parent::__construct(false,$name='Advertisement',$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( $instance['title'] ) ); $bannerPath=json_decode ($instance['bannerPath'],true); $bannerUrl=json_decode ($instance['bannerUrl'],true); $bannerTitle=json_decode ($instance['bannerTitle'],true); $bannerAlt=json_decode ($instance['bannerAlt'],true); echo $before_widget; if ( $title ) echo $before_title . $title . $after_title; /*inner widget html */ if(count($bannerPath)) foreach($bannerPath as $key => $value) { if ($bannerPath[$key] <> '') { ?> <?php echo $bannerAlt[$key]; ?> 'Advertisement', 'bannerPath'=>'', 'bannerUrl'=>'', 'bannerTitle'=>'', 'bannerAlt'=>'') ); $title = esc_html($instance['title']); $bannerPath=json_decode ($instance['bannerPath'],true); $bannerUrl=json_decode ($instance['bannerUrl'],true); $bannerTitle=json_decode ($instance['bannerTitle'],true); $bannerAlt=json_decode ($instance['bannerAlt'],true); /* Title */ ?>

'; ?>
$value){ /* var_dump($bannerPath) */ ?>
Banner
Remove





Banner 1
Remove





get_field_id('bannerPath') . '" name="' . $this->get_field_name('bannerPath') . '" type="hidden" value=\'' .$instance['bannerPath'] . '\' />'; echo ''; echo ''; echo ''; } } /* end Business_elite_adv class */ add_action('widgets_init', create_function('', 'return register_widget("Business_elite_adv");')) ?>