WC_Product_Download::get_type_of_file_path() public WC 1.0
Get type of file path set.
{} Это метод класса: WC_Product_Download{}
Хуков нет.
Возвращает
Строку. absolute, relative, or shortcode.
Использование
$WC_Product_Download = new WC_Product_Download(); $WC_Product_Download->get_type_of_file_path( $file_path );
- $file_path(строка)
- optional.
Код WC_Product_Download::get_type_of_file_path() WC Product Download::get type of file path WC 5.0.0
public function get_type_of_file_path( $file_path = '' ) {
$file_path = $file_path ? $file_path : $this->get_file();
if ( 0 === strpos( $file_path, 'http' ) || 0 === strpos( $file_path, '//' ) ) {
return 'absolute';
} elseif ( '[' === substr( $file_path, 0, 1 ) && ']' === substr( $file_path, -1 ) ) {
return 'shortcode';
} else {
return 'relative';
}
}