Skip to content
Docs
Get RestroPress

Filter

rpress_menu_section_order

Updated
On this page

Filters the order of the rails, category navigation and service row above the menu items.

The incoming order comes from the layout's sections value, with missing parts put back in their default places. The result may contain only 'rails', 'nav' and 'service'; other values and duplicates are removed. The list menu template prints the parts in this order and does not restore a part you leave out. If rails come first they print above the menu columns, otherwise inside the menu column.

Available since RestroPress 3.5.1.

Parameters#

ParameterTypeDescription
$orderstring[]Some order of 'rails', 'nav' and 'service'.

Return value#

string[]. Ordered part keys.

Example#

add_filter( 'rpress_menu_section_order', 'my_section_order', 10, 1 );
function my_section_order( $order ) {
	return array( 'service', 'nav', 'rails' );
}

Notes#

The grid menu template keeps its own order of navigation and service row; there the order only decides where the rails go. Keep all three keys unless you mean to hide a part in the list template.

Source#

Applied in:

  • includes/features/storefront-layout/functions.php (line 530), in rpress_menu_section_order()

See also#

Was this page helpful?