Filter
rpress_storefront_rail_limit
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#
| Parameter | Type | Description |
|---|---|---|
$limit | int | Maximum items. Default 8. |
$rail | string | Rail 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), inrpress_storefront_rail_items()
See also#
Was this page helpful?
