Automattic\WooCommerce\Blocks\Domain\Services

CheckoutFields::get_field_location()publicWC 1.0

Gets the location of a field.

Method of the class: CheckoutFields{}

No Hooks.

Return

String. The location of the field.

Usage

$CheckoutFields = new CheckoutFields();
$CheckoutFields->get_field_location( $field_key );
$field_key(string) (required)
The key of the field to get the location for.

CheckoutFields::get_field_location() code WC 9.0.1

public function get_field_location( $field_key ) {
	foreach ( $this->fields_locations as $location => $fields ) {
		if ( in_array( $field_key, $fields, true ) ) {
			return $location;
		}
	}
	return '';
}