Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.