WC_Download_Handler::derive_filename_from_file_path
Derive a download filename from the file path or URL it will be served from.
Метод класса: WC_Download_Handler{}
Хуков нет.
Возвращает
string.
Использование
$result = WC_Download_Handler::derive_filename_from_file_path( $file_path );
- $file_path(строка) (обязательный)
- File path or URL.
Код WC_Download_Handler::derive_filename_from_file_path() WC Download Handler::derive filename from file path WC 11.3.0
private static function derive_filename_from_file_path( $file_path ) {
$filename = basename( $file_path );
if ( strstr( $filename, '?' ) ) {
$filename = current( explode( '?', $filename ) );
}
return $filename;
}