WC_Meta_Box_Order_Data::get_shipping_fields()protected staticWC 1.0

Get shipping fields for the meta box.

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

Хуки из метода

Возвращает

Массив.

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

$result = WC_Meta_Box_Order_Data::get_shipping_fields( $order, $context );
$order(\WC_Order)
Order object.
По умолчанию: false
$context(строка)
Context of fields (view or edit).
По умолчанию: 'edit'

Код WC_Meta_Box_Order_Data::get_shipping_fields() WC 9.4.2

protected static function get_shipping_fields( $order = false, $context = 'edit' ) {
	/**
	 * Provides an opportunity to modify the list of order shipping fields displayed on the admin.
	 *
	 * @since 1.4.0
	 *
	 * @param array Shipping fields.
	 * @param WC_Order|false $order Order object.
	 * @param string $context Context of fields (view or edit).
	 */
	return apply_filters(
		'woocommerce_admin_shipping_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,
				'type'    => 'select',
				'class'   => 'js_field-country select short',
				'options' => array( '' => __( 'Select a country / region…', 'woocommerce' ) ) + WC()->countries->get_shipping_countries(),
			),
			'state'      => array(
				'label' => __( 'State / County', 'woocommerce' ),
				'class' => 'js_field-state select short',
				'show'  => false,
			),
			'phone'      => array(
				'label' => __( 'Phone', 'woocommerce' ),
			),
		),
		$order,
		$context
	);
}