Skip to content

Instantly share code, notes, and snippets.

@codingmusician
Last active February 12, 2019 22:31
Show Gist options
  • Save codingmusician/28540d12c8102543e6cf64a2286b5ef7 to your computer and use it in GitHub Desktop.
Save codingmusician/28540d12c8102543e6cf64a2286b5ef7 to your computer and use it in GitHub Desktop.
<?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