Use parent post excerpt if summary is empty in roundup list

Plugin Author
Brecht

(@brechtvds)

Hi there,

You’re right. The filter only gets applied if there actually is any output at the moment. It would make sense to change that for a next update.

We do have the wprm_recipe_field filter hook as well. That could be used to change what the $recipe->summary() function returns:

function adjust_recipe_summary( $value, $field, $recipe ) {
if ( 'summary' === $field ) {
if ( ! $value ) {
$parent_post_id = $recipe->parent_post_id();

if ( $parent_post_id ) {
...
}
}
}

return $value;
}
add_filter( 'wprm_recipe_field', 'adjust_recipe_summary', 10, 3 );

 

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