__('Displays Advertisements', 'portfolio-gallery')); $control_ops = array('width' => 400, 'height' => 500); parent::__construct(false,$name=__('Advertisement', 'portfolio-gallery'), $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; ///iner widget html if(count($bannerPath)) foreach($bannerPath as $key => $value) { if ($bannerPath[$key] <> '') { ?> <?php echo $bannerAlt[$key]; ?> __('Advertisement', 'portfolio-gallery'), 'bannerPath'=>'', 'bannerUrl'=>'', 'bannerTitle'=>'', 'bannerAlt'=>'') ); $title = esc_attr($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 of class add_action('widgets_init', create_function('', 'return register_widget("Portfolio_gallery_adv");')) ?>