WC_Product_Importer::normalize_global_unique_id │ protected │ WC 11.2.0

Reduce a Global Unique ID to the form it is stored in.

Keep this in step with the stripping in WC_Product::set_global_unique_id(), so a row is matched and judged usable on the same value the product would be saved with.

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

Хуков нет.

Возвращает

string. Stored form of the Global Unique ID, or an empty string when nothing is left of it.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->normalize_global_unique_id( $global_unique_id );
$global_unique_id(строка) (обязательный)
Global Unique ID as entered in the row.

Список изменений

С версии 11.2.0 Введена.

Код WC_Product_Importer::normalize_global_unique_id() WC 11.3.0

protected function normalize_global_unique_id( $global_unique_id ) {
	return (string) preg_replace( '/[^0-9Xx\-]/', '', (string) $global_unique_id );
}