WC_Product_CSV_Importer::parse_download_file_field()publicWC 1.0

Parse download file urls, we should allow shortcodes here.

Allow shortcodes if present, otherwise esc_url the value.

Метод класса: WC_Product_CSV_Importer{}

Хуков нет.

Возвращает

Строку.

Использование

$WC_Product_CSV_Importer = new WC_Product_CSV_Importer();
$WC_Product_CSV_Importer->parse_download_file_field( $value );
$value(строка) (обязательный)
Field value.

Код WC_Product_CSV_Importer::parse_download_file_field() WC 8.7.0

public function parse_download_file_field( $value ) {
	// Absolute file paths.
	if ( 0 === strpos( $value, 'http' ) ) {
		return esc_url_raw( $value );
	}
	// Relative and shortcode paths.
	return wc_clean( $value );
}