Automattic\WooCommerce\Internal\CLI\Migrator\Platforms\Webflow

WebflowMapper::map_statusprivateWC 1.0

Map Webflow product publication flags to WC status.

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

Хуков нет.

Возвращает

Строку.

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

// private - только в коде основоного (родительского) класса
$result = $this->map_status( $product ): string;
$product(объект) (обязательный)
Product object.

Код WebflowMapper::map_status() WC 11.0.1

private function map_status( object $product ): string {
	$is_archived = ! empty( $product->isArchived ); // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase -- Webflow API uses camelCase.
	$is_draft    = ! empty( $product->isDraft );    // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase -- Webflow API uses camelCase.

	if ( $is_archived ) {
		return 'draft';
	}
	if ( $is_draft ) {
		return 'draft';
	}
	return 'publish';
}