Automattic\WooCommerce\Blocks\Domain\Services
CheckoutFields::get_group_name
Returns a group name based on passed group key.
Method of the class: CheckoutFields{}
No Hooks.
Returns
String. The group meta prefix.
Usage
$result = CheckoutFields::get_group_name( $group_key );
- $group_key(string) (required)
- The group name (_wc_billing|_wc_shipping|_wc_other).
CheckoutFields::get_group_name() CheckoutFields::get group name code WC 10.7.0
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';
}