WordPress.org

Ready to get started?Download WordPress

Forums

Get filename from widget form (1 post)

  1. willsy
    Member
    Posted 4 years ago #

    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 !

Topic Closed

This topic has been closed to new replies.

About this Topic