= $field['type'] ) { $value = $value ? __( 'Yes', 'woocommerce' ) : __( 'No', 'woocommerce' ); } if ( 'select' === $field['type'] ) { $options = array_column( $field['options'], 'label', 'value' ); $value = isset( $options[ $value ] ) ? $options[ $value ] : $value; } return $value; } /** * Returns a group meta prefix based on its name. * * @param string $group_name The group name (billing|shipping|other). * @return string The group meta prefix. */ public static function get_group_key( $group_name ) { if ( 'additional' === $group_name ) { wc_deprecated_argument( 'group_name', '8.9.0', 'The "additional" group is deprecated. Use "other" instead.' ); $group_name = 'other'; } if ( 'billing' === $group_name ) { return self::BILLING_FIELDS_PREFIX; } if ( 'shipping' === $group_name ) { return self::SHIPPING_FIELDS_PREFIX; } return self::OTHER_FIELDS_PREFIX; } /** * Returns a group name based on passed group key. * * @param string $group_key The group name (_wc_billing|_wc_shipping|_wc_other). * @return string The group meta prefix. */ 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'; } }