Automattic\WooCommerce\Blocks\Domain\Services

CheckoutFields::get_field_location()publicWC 1.0

Gets the location of a field.

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

Хуков нет.

Возвращает

Строку. The location of the field.

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

$CheckoutFields = new CheckoutFields();
$CheckoutFields->get_field_location( $field_key );
$field_key(строка) (обязательный)
The key of the field to get the location for.

Код CheckoutFields::get_field_location() WC 9.5.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 '';
}