Plugin Not Working
-
Hello,
I need to have multi uploading image functionality in my custom widget.
<?php
function form($instance) {
/*For single image upload*/
//$image_uri = isset( $instance[‘image_uri’] ) ? esc_url_raw( $instance[‘image_uri’] ) : ”;/*For multiple image upload*/
$image_uri = pco_image_field( $this, $instance, array( ‘field’ => ‘image_uri’ );if ( $image_uri != ” ) :
echo ‘<p></p>’;
endif;
?>
<p><label for=”<?php echo $this->get_field_id(‘image_uri’); ?>”><?php _e(‘Upload image.’, ‘abc’); ?></label></p>
<p><input type=”button” class=”button button-primary custom_media_button” id=”custom_media_button” name=”<?php echo $this->get_field_name(‘image_uri’); ?>” value=”Upload Image” style=”margin-top:5px;” /></p>
<p><input class=”widefat custom_media_url” id=”<?php echo $this->get_field_id( ‘image_uri’ ); ?>” name=”<?php echo $this->get_field_name( ‘image_uri’ ); ?>” type=”text” value=”<?php echo $image_uri; ?>” size=”3″ /></p><p>
<label for=”<?php echo $this->get_field_id(‘content’); ?>”><?php _e(‘CSR Content’, ‘abc’); ?></label>
<textarea class=”widefat” id=”<?php echo $this->get_field_id(‘content’); ?>” name=”<?php echo $this->get_field_name(‘content’); ?>”><?php echo $content; ?></textarea>
</p><?php
}How should i use it in
function update($new_instance, $old_instance) & function widget($args, $instance) function. Kindly help me out for the same.
- The topic ‘Plugin Not Working’ is closed to new replies.