Automattic\WooCommerce\Blocks\Domain\Services

CheckoutFields::get_group_name()public staticWC 1.0

Returns a group name based on passed group key.

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

Хуков нет.

Возвращает

Строку. The group meta prefix.

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

$result = CheckoutFields::get_group_name( $group_key );
$group_key(строка) (обязательный)
The group name (_wc_billing|_wc_shipping|_wc_other).

Код CheckoutFields::get_group_name() WC 9.8.1

public static function get_group_name( $group_key ) {
	if ( '_wc_additional' === $group_key ) {
		wc_deprecated_argument( 'group_key', '8.9.0', 'The "_wc_additional" group key is deprecated. Use "_wc_other" instead.' );
		$group_key = '_wc_other';
	}
	if ( 0 === \strpos( self::BILLING_FIELDS_PREFIX, $group_key ) ) {
		return 'billing';
	}
	if ( 0 === \strpos( self::SHIPPING_FIELDS_PREFIX, $group_key ) ) {
		return 'shipping';
	}
	return 'other';
}