Title: Nate Mackey's Replies | WordPress.org

---

# Nate Mackey

  [  ](https://wordpress.org/support/users/mackeyngmailcom/)

 *   [Profile](https://wordpress.org/support/users/mackeyngmailcom/)
 *   [Topics Started](https://wordpress.org/support/users/mackeyngmailcom/topics/)
 *   [Replies Created](https://wordpress.org/support/users/mackeyngmailcom/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/mackeyngmailcom/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/mackeyngmailcom/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/mackeyngmailcom/engagements/)
 *   [Favorites](https://wordpress.org/support/users/mackeyngmailcom/favorites/)

 Search replies:

## Forum Replies Created

Viewing 1 replies (of 1 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Verve Meta Boxes] [Plugin: Verve Meta Boxes] Issue uploading images](https://wordpress.org/support/topic/plugin-verve-meta-boxes-issue-uploading-images/)
 *  Thread Starter [Nate Mackey](https://wordpress.org/support/users/mackeyngmailcom/)
 * (@mackeyngmailcom)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/plugin-verve-meta-boxes-issue-uploading-images/#post-2455232)
 * The code snippet I uploaded is diff or patch. The – and + signs at the front 
   of each line indicate what changed between the original and updated versions.
   The final code block for uploading files and images should be the following:
 *     ```
       if( $field_type == 'image' || $field_type == 'file' ){
   
                               if( isset($_FILES[$key]) && !vmb_is_empty($_FILES[$key]['name']) ){
   
                                       /////////////////// HANDLE FILE UPLOAD and POPULATE VALUE VARIABLE
                                       $overrides      = array('test_form' => false); //WHY DOES THIS NEED TO BE HERE?
                                       $image          = wp_handle_upload($_FILES[$key],$overrides);
   
                                       if (empty($image['error'])) {
                                               $value          = $image["url"];
                                               if( vmb_is_empty($value) ){
                                                       delete_post_meta($post_id, $key);
                                               }else{
                                                       update_post_meta($post_id, $key, $value);
                                               }
                                       }
                               }
                       }
       ```
   

Viewing 1 replies (of 1 total)