Automattic\WooCommerce\Blocks\BlockTypes\ProductCollection
Controller::register_settings
Exposes settings used by the Product Collection block when manipulating the default query.
Method of the class: Controller{}
No Hooks.
Returns
null. Nothing (null).
Usage
$Controller = new Controller(); $Controller->register_settings();
Controller::register_settings() Controller::register settings code WC 10.8.1
public function register_settings() {
register_setting(
'options',
'woocommerce_default_catalog_orderby',
array(
'type' => 'object',
'description' => __( 'How should products be sorted in the catalog by default?', 'woocommerce' ),
'label' => __( 'Default product sorting', 'woocommerce' ),
'show_in_rest' => array(
'name' => 'woocommerce_default_catalog_orderby',
'schema' => array(
'type' => 'string',
'enum' => array( 'menu_order', 'popularity', 'rating', 'date', 'price', 'price-desc' ),
),
),
'default' => 'menu_order',
)
);
}