WC_Meta_Box_Order_Data::get_billing_fields()
Get billing fields for the meta box.
Метод класса: WC_Meta_Box_Order_Data{}
Хуки из метода
Возвращает
Массив
.
Использование
$result = WC_Meta_Box_Order_Data::get_billing_fields( $order, $context );
- $order(\WC_Order)
- Order object.
По умолчанию: false - $context(строка)
- Context of fields (view or edit).
По умолчанию: 'edit'
Код WC_Meta_Box_Order_Data::get_billing_fields() WC Meta Box Order Data::get billing fields WC 9.3.3
protected static function get_billing_fields( $order = false, $context = 'edit' ) { /** * Provides an opportunity to modify the list of order billing fields displayed on the admin. * * @since 1.4.0 * * @param array Billing fields. * @param WC_Order|false $order Order object. * @param string $context Context of fields (view or edit). */ return apply_filters( 'woocommerce_admin_billing_fields', array( 'first_name' => array( 'label' => __( 'First name', 'woocommerce' ), 'show' => false, ), 'last_name' => array( 'label' => __( 'Last name', 'woocommerce' ), 'show' => false, ), 'company' => array( 'label' => __( 'Company', 'woocommerce' ), 'show' => false, ), 'address_1' => array( 'label' => __( 'Address line 1', 'woocommerce' ), 'show' => false, ), 'address_2' => array( 'label' => __( 'Address line 2', 'woocommerce' ), 'show' => false, ), 'city' => array( 'label' => __( 'City', 'woocommerce' ), 'show' => false, ), 'postcode' => array( 'label' => __( 'Postcode / ZIP', 'woocommerce' ), 'show' => false, ), 'country' => array( 'label' => __( 'Country / Region', 'woocommerce' ), 'show' => false, 'class' => 'js_field-country select short', 'type' => 'select', 'options' => array( '' => __( 'Select a country / region…', 'woocommerce' ) ) + WC()->countries->get_allowed_countries(), ), 'state' => array( 'label' => __( 'State / County', 'woocommerce' ), 'class' => 'js_field-state select short', 'show' => false, ), 'email' => array( 'label' => __( 'Email address', 'woocommerce' ), ), 'phone' => array( 'label' => __( 'Phone', 'woocommerce' ), ), ), $order, $context ); }