Last active
February 12, 2019 22:31
-
-
Save codingmusician/28540d12c8102543e6cf64a2286b5ef7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Description: Modify JSON-LD structured data for a single event | |
* | |
* Usage: copy the snippet in your active (child) theme's functions.php file | |
* | |
* Plugins: The Events Calendar | |
* Author: Modern Tribe | |
* Last updated: February 12, 2019 | |
*/ | |
function tribe_ldjson_add_performer($data){ | |
if(is_singular(TribeEvents::POSTTYPE)){ | |
$data[get_the_ID()]->performer = json_decode(json_encode(["name"=>""])); | |
} | |
return $data; | |
} | |
add_filter("tribe_json_ld_event_data", "tribe_ldjson_add_performer", 10, 1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment