Automattic\WooCommerce\Blocks\Domain\Services
CheckoutFields::get_field_location
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() CheckoutFields::get field location WC 10.4.2
public function get_field_location( $field_key ) {
if ( ! $this->is_field( $field_key ) ) {
return '';
}
foreach ( $this->fields_locations as $location => $fields ) {
if ( in_array( $field_key, $fields, true ) ) {
return $location;
}
}
return '';
}