false); // save the file, and store an array, containing its location in $file $file = wp_handle_upload( $image, $overrides ); $input[$keys[$i]] = $file; } else { // Not an image. $options = get_option( 'plugin_options' ); $input[$keys[$i]] = $options[$keys[$i]]; // Die and let the user know that they made a mistake. wp_die( 'No image was uploaded.' ); } } // Else, the user didn't upload a file. // Retain the image that's already on file. else { $options = get_option( 'plugin_options' ); $input[$keys[$i]] = $options[$keys[$i]]; } $i++; endforeach; return $input; // return validated input } ?>