WooCommerce Code Reference

WC_Admin_Upload_Downloadable_Product
in package

WC_Admin_Upload_Downloadable_Product Class.

Table of Contents

__construct()  : mixed
Add hooks.
unique_filename()  : string
Change filename to append random text.
update_filename()  : string
Change filename for WooCommerce uploads and prepend unique chars for security.
upload_dir()  : array<string|int, mixed>
Change upload dir for downloadable files.
woocommerce_media_upload_downloadable_product()  : mixed
Run a filter when uploading a downloadable product.

Methods

unique_filename()

Change filename to append random text.

public unique_filename(string $full_filename, string $ext) : string
Parameters
$full_filename : string

Original filename with extension.

$ext : string

Extension.

Return values
stringModified filename.

update_filename()

Change filename for WooCommerce uploads and prepend unique chars for security.

public update_filename(string $full_filename, string $ext, string $dir) : string
Parameters
$full_filename : string

Original filename.

$ext : string

Extension of file.

$dir : string

Directory path.

Tags
since
4.0
Return values
stringNew filename with unique hash.

upload_dir()

Change upload dir for downloadable files.

public upload_dir(array<string|int, mixed> $pathdata) : array<string|int, mixed>
Parameters
$pathdata : array<string|int, mixed>

Array of paths.

Return values
array<string|int, mixed>