Skip to content
Docs
Get RestroPress

Filter

rpress_is_menu_schema_page

Updated
On this page

Filters whether the current singular page counts as a menu page for schema output.

Runs in RPRESS_Menu_Schema::is_menu_page() on singular views. The default is true when the page is the configured menu page, contains the fooditems shortcode or contains the rpress/food-menu block. Return true to output menu schema on other pages. The post argument is null if the queried object is not a WP_Post.

Available since RestroPress 3.5.

Parameters#

ParameterTypeDescription
$is_menuboolDetected value.
$postWP_Post|nullQueried post.

Return value#

bool. True to treat the page as a menu page.

Example#

function my_is_menu_page( $is_menu, $post ) {
	return $is_menu || ( $post && 'our-menu' === $post->post_name );
}
add_filter( 'rpress_is_menu_schema_page', 'my_is_menu_page', 10, 2 );

Source#

Applied in:

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

See also#

Was this page helpful?