Filter: Customize recipe time display

If you want to customize how your recipe times are displayed, we now have a filter for that! Tasty Recipes 2.6.0 has an added ‘tasty_recipes_human_time_formats' filter to modify the total time output format. 

Here's an example of the filter you would apply in your functions.php file: 

add_filter('tasty_recipes_human_time_formats', function() {
return array(
'individual_hour'              => __( '%shr', 'tasty-recipes' ),
'multiple_hours'               => __( '%shrs', 'tasty-recipes' ),
'multiple_hours_with_minutes'  => __( '%1$shrs %2$smins', 'tasty-recipes' ),
'individual_hour_with_minutes' => __( '%1$shr %2$smins', 'tasty-recipes' ),
'individual_minute'            => __( '%smin', 'tasty-recipes' ),
'multiple_minutes'             => __( '%smins', 'tasty-recipes' ),
);
}
);
Was this article helpful?

Related Articles

Need Support?

Can't find the answer you're looking for?
Contact Support