parent
df55670bf0
commit
00c1a9016a
|
@ -1532,7 +1532,7 @@ class WC_API_Products extends WC_API_Resource {
|
|||
}
|
||||
|
||||
$download = new WC_Product_Download();
|
||||
$download->set_id( $file['id'] ? $file['id'] : wp_generate_uuid4() );
|
||||
$download->set_id( ! empty( $file['id'] ) ? $file['id'] : wp_generate_uuid4() );
|
||||
$download->set_name( $file['name'] ? $file['name'] : wc_get_filename_from_url( $file['file'] ) );
|
||||
$download->set_file( apply_filters( 'woocommerce_file_download_path', $file['file'], $product, $key ) );
|
||||
$files[] = $download;
|
||||
|
|
|
@ -2036,7 +2036,7 @@ class WC_API_Products extends WC_API_Resource {
|
|||
}
|
||||
|
||||
$download = new WC_Product_Download();
|
||||
$download->set_id( $file['id'] ? $file['id'] : wp_generate_uuid4() );
|
||||
$download->set_id( ! empty( $file['id'] ) ? $file['id'] : wp_generate_uuid4() );
|
||||
$download->set_name( $file['name'] ? $file['name'] : wc_get_filename_from_url( $file['file'] ) );
|
||||
$download->set_file( apply_filters( 'woocommerce_file_download_path', $file['file'], $product, $key ) );
|
||||
$files[] = $download;
|
||||
|
|
|
@ -960,7 +960,7 @@ class WC_REST_Products_V1_Controller extends WC_REST_Posts_Controller {
|
|||
}
|
||||
|
||||
$download = new WC_Product_Download();
|
||||
$download->set_id( $file['id'] ? $file['id'] : wp_generate_uuid4() );
|
||||
$download->set_id( ! empty( $file['id'] ) ? $file['id'] : wp_generate_uuid4() );
|
||||
$download->set_name( $file['name'] ? $file['name'] : wc_get_filename_from_url( $file['file'] ) );
|
||||
$download->set_file( apply_filters( 'woocommerce_file_download_path', $file['file'], $product, $key ) );
|
||||
$files[] = $download;
|
||||
|
|
|
@ -1196,7 +1196,7 @@ class WC_REST_Products_V2_Controller extends WC_REST_Legacy_Products_Controller
|
|||
}
|
||||
|
||||
$download = new WC_Product_Download();
|
||||
$download->set_id( $file['id'] ? $file['id'] : wp_generate_uuid4() );
|
||||
$download->set_id( ! empty( $file['id'] ) ? $file['id'] : wp_generate_uuid4() );
|
||||
$download->set_name( $file['name'] ? $file['name'] : wc_get_filename_from_url( $file['file'] ) );
|
||||
$download->set_file( apply_filters( 'woocommerce_file_download_path', $file['file'], $product, $key ) );
|
||||
$files[] = $download;
|
||||
|
|
Loading…
Reference in New Issue