WordPress at Your Fingertips
function is not described

WC_Shop_Customizer::sanitize_default_catalog_orderby() public WC 1.0

Sanitize the catalog orderby setting.

{} It's a method of the class: WC_Shop_Customizer{}

Return

String.

Usage

$WC_Shop_Customizer = new WC_Shop_Customizer();
$WC_Shop_Customizer->sanitize_default_catalog_orderby( $value );
$value(string) (required)
An array key from the below array.

Code of WC_Shop_Customizer::sanitize_default_catalog_orderby() WC 5.6.0

public function sanitize_default_catalog_orderby( $value ) {
	$options = apply_filters(
		'woocommerce_default_catalog_orderby_options',
		array(
			'menu_order' => __( 'Default sorting (custom ordering + name)', 'woocommerce' ),
			'popularity' => __( 'Popularity (sales)', 'woocommerce' ),
			'rating'     => __( 'Average rating', 'woocommerce' ),
			'date'       => __( 'Sort by most recent', 'woocommerce' ),
			'price'      => __( 'Sort by price (asc)', 'woocommerce' ),
			'price-desc' => __( 'Sort by price (desc)', 'woocommerce' ),
		)
	);

	return array_key_exists( $value, $options ) ? $value : 'menu_order';
}