Add functionality to handle import files hosted on server
This commit is contained in:
parent
216dce4fab
commit
b1739dd21d
|
@ -329,6 +329,13 @@ class WC_Product_CSV_Importer_Controller {
|
|||
}
|
||||
|
||||
return ABSPATH . $file_url;
|
||||
} elseif ( file_exists( $file_url ) ) {
|
||||
$filetype = wp_check_filetype( $file_url, $valid_filetypes );
|
||||
if ( ! in_array( $filetype['type'], $valid_filetypes, true ) ) {
|
||||
return new WP_Error( 'woocommerce_product_csv_importer_upload_file_invalid', __( 'Invalid file type. The importer supports CSV and TXT file formats.', 'woocommerce' ) );
|
||||
}
|
||||
|
||||
return $file_url;
|
||||
}
|
||||
// phpcs:enable
|
||||
|
||||
|
|
Loading…
Reference in New Issue