Skip to content
Docs
Get RestroPress

Filter

rpress_storefront_rail_limit

Updated
On this page

Filters the maximum number of menu items a storefront rail shows.

Applied for each rail in rpress_storefront_rail_items() and used to limit the item query. Values below 1 are raised to 1. Unavailable items are removed after the limit is applied, so a rail can show fewer.

Available since RestroPress 3.5.1.

Parameters#

ParameterTypeDescription
$limitintMaximum items. Default 8.
$railstringRail key: 'popular', 'order_again' or 'deals'.

Return value#

int. Maximum items.

Example#

add_filter( 'rpress_storefront_rail_limit', 'my_rail_limit', 10, 2 );
function my_rail_limit( $limit, $rail ) {
	return 'popular' === $rail ? 12 : $limit;
}

Source#

Applied in:

  • includes/features/storefront-layout/functions.php (line 350), in rpress_storefront_rail_items()

See also#

Was this page helpful?