Automattic\WooCommerce\Blocks\BlockTypes
Checkout::register_settings()
Exposes settings exposed by the checkout block.
Метод класса: Checkout{}
Хуков нет.
Возвращает
null
. Ничего (null).
Использование
$Checkout = new Checkout(); $Checkout->register_settings();
Код Checkout::register_settings() Checkout::register settings WC 9.8.5
public function register_settings() { register_setting( 'options', 'woocommerce_checkout_phone_field', array( 'type' => 'object', 'description' => __( 'Controls the display of the phone field in checkout.', 'woocommerce' ), 'label' => __( 'Phone number', 'woocommerce' ), 'show_in_rest' => array( 'name' => 'woocommerce_checkout_phone_field', 'schema' => array( 'type' => 'string', 'enum' => array( 'optional', 'required', 'hidden' ), ), ), 'default' => CartCheckoutUtils::get_phone_field_visibility(), ) ); register_setting( 'options', 'woocommerce_checkout_company_field', array( 'type' => 'object', 'description' => __( 'Controls the display of the company field in checkout.', 'woocommerce' ), 'label' => __( 'Company', 'woocommerce' ), 'show_in_rest' => array( 'name' => 'woocommerce_checkout_company_field', 'schema' => array( 'type' => 'string', 'enum' => array( 'optional', 'required', 'hidden' ), ), ), 'default' => CartCheckoutUtils::get_company_field_visibility(), ) ); register_setting( 'options', 'woocommerce_checkout_address_2_field', array( 'type' => 'object', 'description' => __( 'Controls the display of the apartment (address_2) field in checkout.', 'woocommerce' ), 'label' => __( 'Address Line 2', 'woocommerce' ), 'show_in_rest' => array( 'name' => 'woocommerce_checkout_address_2_field', 'schema' => array( 'type' => 'string', 'enum' => array( 'optional', 'required', 'hidden' ), ), ), 'default' => CartCheckoutUtils::get_address_2_field_visibility(), ) ); }