1. Home
  2. Knowledge Base
  3. Tasty Recipes
  4. Customizing Tasty Recipes
  5. Filter: Edit “Equipment” label in recipe card

Filter: Edit “Equipment” label in recipe card

If you're interested in editing the label of the Equipment section to say something else (i.e. “Recommended Products”), you'll need to add the following snippet to your site's functions.php file:

/**
 * Replaces the 'Equipment' heading with something else.
 *
 * @param string $output Existing card output.
 * @return string
 */
add_filter(
	'tasty_recipes_recipe_card_output',
	function( $output ) {
		$new    = 'Favorite Products';
		$output = preg_replace( '#(<h3[^>]*>)(Equipment)(</h3>)#', '$1' . $new . '$3', $output );
		return $output;
	}
);

You'll just need to edit the Favorite Products bit with the text of your choosing. Voilà!

Was this article helpful?

Related Articles

Need Support?

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