Support » Plugins » Get filename from widget form

  • willsy


    Hi, I am modifying an existing widget, and added the following to the form so that I can upload a file. However, I don’t understand how to pull out the file information in the update() method:

    function form($instance) {
    			<p><input class="widefat" id="<?php echo $this->get_field_id('filename'); ?>" name="<?php echo $this->get_field_name('filename'); ?>" type="file" /></p>

    then in update() method I was trying this,

    $instance['filename'] = strip_tags($new_instance['filename']);

    but when I print this out to a log file it is always blank.

    Any pointers would be appreciated.
    Cheers !

  • The topic ‘Get filename from widget form’ is closed to new replies.