Filter
rpress_output_menu_schema
On this page
Filters whether RestroPress prints its menu schema (JSON-LD) on the current page.
Runs in RPRESS_Menu_Schema::should_output(). The default is true unless the setting is off or an SEO plugin already outputs Restaurant schema. Return true to force output, false to drop it.
Available since RestroPress 3.5.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$output | bool | Whether to output the schema. |
$post_id | int | Current post ID. |
$seo | string | Detected SEO plugin name, or an empty string. |
Return value#
bool. True to print the schema.
Example#
function my_output_menu_schema( $output, $post_id, $seo ) {
return '' !== $seo ? false : $output;
}
add_filter( 'rpress_output_menu_schema', 'my_output_menu_schema', 10, 3 );
Source#
Applied in:
includes/features/qr-schema/class-rpress-menu-schema.php(line 229), inRPRESS_Menu_Schema::should_output()
See also#
Was this page helpful?
