Skip to content

Instantly share code, notes, and snippets.

@slimndap
Last active February 6, 2016 16:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slimndap/0e862482880cbcd68a12 to your computer and use it in GitHub Desktop.
Save slimndap/0e862482880cbcd68a12 to your computer and use it in GitHub Desktop.
Filter the venue name inside structured event data and always set it to the name of your theater. Place the code inside the functions.php of your theme. For use with the Rich Snippets for Theater plugin (http://theater.slimndap.com/downloads/rich-snippets-theater/).
<?php
/**
* Sets the venue to a fixed value inside structured event data.
*
* @param string $name The original venue value.
* @param WPT_Event $event The event.
* @return string The new venue value.
*/
function wpt_structured_data_set_location_name($name, $event) {
return 'My Theater Name'; // Replace this with the name of your theater.
}
add_filter('wpt/structured_data/event/location/name', 'wpt_structured_data_set_location_name', 10, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment