woocommerce_json_search_limit │ filter-hook │ WC 3.5.0

Filters the number of results returned by the JSON search endpoints.

Usage

add_filter( 'woocommerce_json_search_limit', 'wp_kama_woocommerce_json_search_limit_filter' );

/**
 * Function for `woocommerce_json_search_limit` filter-hook.
 * 
 * @param int $limit Maximum number of results to return.
 *
 * @return int
 */
function wp_kama_woocommerce_json_search_limit_filter( $limit ){
	// filter...
	return $limit;
}
$limit(int)
Maximum number of results to return.

Changelog

Since 3.5.0 Introduced.

Where the hook is called

WC_AJAX::json_search_tax_rates()
woocommerce_json_search_limit
WC_AJAX::json_search_products()
woocommerce_json_search_limit
WC_AJAX::json_search_downloadable_products_and_variations()
woocommerce_json_search_limit
woocommerce/includes/class-wc-ajax.php 1906
$default_per_page = absint( apply_filters( 'woocommerce_json_search_limit', 30 ) );
woocommerce/includes/class-wc-ajax.php 2102
$limit = absint( apply_filters( 'woocommerce_json_search_limit', 30 ) );
woocommerce/includes/class-wc-ajax.php 2209
$limit = absint( apply_filters( 'woocommerce_json_search_limit', 30 ) );

Where the hook is used in WooCommerce

Usage not found.