Can I adjust the schema markup of plugin WP recipe maker

Plugin Author
Brecht

(@brechtvds)

Hi there,

Happy to hear you’re enjoying the plugin! We actually have the wprm_recipe_metadata filter hook that could be used to alter the recipe schema. Are you familiar with how to use that?

What changes are you trying to make specifically?

Kind regards,
Brecht

Thread Starter
gale13

(@gale13)

Hi,

I want to add terms About and Mentions, and some info about the author.

Plugin Author
Brecht

(@brechtvds)

To give you a specific example, you can do that by adding code like this to your theme’s functions.php file (or as a Code Snippet):

function change_wprm_recipe_metadata( $metadata, $recipe ) {
$author = intval( $recipe->post_author() );

if ( $author ) {
$user = get_userdata( $author );

if ( $user ) {
// Change the author that's used for the metadata.
$metadata['author'] = array( ... );
}
}

return $metadata;
}
add_filter( 'wprm_recipe_metadata', 'change_wprm_recipe_metadata', 10, 2 );

Brecht

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer