so i’ve modified the output code like this :
function widget( $args, $instance, $instanceb ) {
extract( $args, EXTR_SKIP );
// these are the widget options
$image_url = $instance['image_url'];
$image_link = $instanceb['image_link'];
echo $before_widget;
// Display the widget
echo '';
if( $image_url) {
echo '';
}
echo '';
echo $after_widget;
}
and display form like this:
function form( $instance, $instanceb ) {
$instance = wp_parse_args( (array) $instance, $this->defaults );
$instanceb = wp_parse_args( (array) $instanceb, $this->defaults );
?>
<p>
<input id="<?php echo $this->get_field_id('image_link'); ?>" type="text" class="image-url" name="<?php echo $this->get_field_name('image_link'); ?>" value="<?php echo $instanceb['image_link']; ?>" style="width: 100%;" />
<label for="<?php echo $this->get_field_id('image_url'); ?>"><?php _e('Client Logo', 'integral'); ?></label>
<input id="<?php echo $this->get_field_id('image_url'); ?>" type="text" class="image-url" name="<?php echo $this->get_field_name('image_url'); ?>" value="<?php echo $instance['image_url']; ?>" style="width: 100%;" />
<input id="" class="button upload_image_button" type="button" value="<?php _e('Upload','integral') ?>" />
<input id="" class="button clear_image_button" type="button" value="<?php _e('Clear','integral') ?>" />
</p>
<p class="img-prev">
" style="max-width: 100%;">
</p>
<?php
}
i presume i need more modifications 🙂 with constructor too.. but how? can you please advise ? thanks in advance