Created
March 29, 2022 00:02
-
-
Save graylaurenm/a5cdcd23917f9ae1e85dcaeb487f8c5c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'tasty_recipes_recipe_template_vars', __NAMESPACE__ . '\replace_tasty_image_size', 10, 2 ); | |
function replace_tasty_image_size( $template_vars, $recipe ) { | |
$recipe_json = $recipe->to_json(); | |
$template_vars['recipe_image'] = ! empty( $recipe_json['image_sizes']['placement-recipe'] ) ? $recipe_json['image_sizes']['placement-recipe']['html'] : ''; | |
return $template_vars; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment