Checkout logic
This commit is contained in:
@@ -34,7 +34,7 @@ class Wiaas_Document_Upload {
|
||||
// validate file
|
||||
|
||||
if (!isset($_FILES[$file_id])) {
|
||||
return new WP_Error( 'wiaas_upload_missing_file', 'No file!' );
|
||||
return new WP_Error( 'wiaas_upload_error_missing_file', 'No file!' );
|
||||
}
|
||||
|
||||
$file_name = $_FILES[$file_id]['name'];
|
||||
@@ -45,7 +45,7 @@ class Wiaas_Document_Upload {
|
||||
$ext = strtolower($ext);
|
||||
|
||||
if(!in_array($ext, self::$allowed_extensions)) {
|
||||
return new WP_Error( 'wiaas_upload_error', 'Invalid file extension!' );
|
||||
return new WP_Error( 'wiaas_upload_error_invalid_extension', 'Invalid file extension!' );
|
||||
}
|
||||
|
||||
$file = wp_handle_upload(
|
||||
|
||||
Reference in New Issue
Block a user