Home / Admin / Update the author name on published recipes
Duplicate Snippet

Embed Snippet on Your Site

Update the author name on published recipes

This code snippet will update the author name for all existing recipes.

Just replace New Name Here with the author name you would like added.

<10
Code Preview
php
<?php
add_filter( 'tasty_recipes_recipe_template_vars', function( $template_vars ) {
    $template_vars['recipe_author_name'] = 'New name here'; //Replace New name here
    $template_vars['recipe_details']['author']['value'] = '<span>' . $template_vars['recipe_author_name'] . '</span>';
    return $template_vars;
} );

Comments

Add a Comment