Skip to content
Docs
Get RestroPress

Filter

rpress_menu_schema_max_items

Updated
On this page

Filters the maximum number of menu items described in the menu schema.

Runs in RPRESS_Menu_Schema::data() before the published menu items are queried. The default is 500. The value is cast to an integer and clamped to at least 1. Lowering it shrinks the JSON-LD for very large menus.

Available since RestroPress 3.5.

Parameters#

ParameterTypeDescription
$valueintMaximum number of menu items.

Return value#

int. Maximum number of menu items.

Example#

function my_menu_schema_max( $max ) {
	return 200;
}
add_filter( 'rpress_menu_schema_max_items', 'my_menu_schema_max' );

Source#

Applied in:

  • includes/features/qr-schema/class-rpress-menu-schema.php (line 343), in RPRESS_Menu_Schema::data()

See also#

Was this page helpful?