Filter
rpress_is_menu_schema_page
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#
| Parameter | Type | Description |
|---|---|---|
$is_menu | bool | Detected value. |
$post | WP_Post|null | Queried 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), inRPRESS_Menu_Schema::is_menu_page()
See also#
Was this page helpful?
