Skip to content
Docs
Get RestroPress

Filter

rpress_output_menu_schema

Updated
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#

ParameterTypeDescription
$outputboolWhether to output the schema.
$post_idintCurrent post ID.
$seostringDetected 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), in RPRESS_Menu_Schema::should_output()

See also#

Was this page helpful?