trying to use wp_handle_upload with ajax
You need to include a few files to get wp_handle_upload to work, and i have a function just for that : function My_wp_handle_upload($file_handler,$overrides) { // check to make sure its a successful upload if ($_FILES[$file_handler][‘error’] !== UPLOAD_ERR_OK) __return_false(); require_once(ABSPATH . “wp-admin” . ‘/includes/image.php’); require_once(ABSPATH . “wp-admin” . ‘/includes/file.php’); require_once(ABSPATH . “wp-admin” . ‘/includes/media.php’); $upload = … Read more