adding filter comments

This commit is contained in:
Ovidiu Liuta 2022-04-12 11:33:12 +03:00 committed by GitHub
parent 9d9b7464d7
commit 4624ab7dde
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 1 deletions

View File

@ -277,6 +277,13 @@ class WC_Download_Handler {
// Paths that begin with '//' are always remote URLs.
if ( '//' === substr( $file_path, 0, 2 ) ) {
$file_path = ( is_ssl() ? 'https:' : 'http:' ) . $file_path;
/**
* Filter the remote filepath for download.
*
* @since 6.5.0
* @param string $file_path File path.
*/
return array(
'remote_file' => true,
'file_path' => apply_filters( 'woocommerce_download_parse_remote_file_path', $file_path ),
@ -297,7 +304,14 @@ class WC_Download_Handler {
$remote_file = false;
$file_path = $parsed_file_path['path'];
}
/**
* Filter the filepath for download.
*
* @since 6.5.0
* @param string $file_path File path.
* @param bool $remote_file Remote File Indicator.
*/
return array(
'remote_file' => $remote_file,
'file_path' => apply_filters( 'woocommerce_download_parse_file_path', $file_path, $remote_file )