Created
March 21, 2018 09:58
-
-
Save Pebblo/b4deef67fb1cbe6b5c6e297f6b9aebce to your computer and use it in GitHub Desktop.
Example of how to change the event title to 'Venue Booked' if you event is within a 'Private' category.
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 //Please do NOT include the opening php tag, except of course if you're starting with a blank file | |
function tw_ee_EE_Datetime_In_Calendar__to_array_for_json__title( $original_title, $datetime_in_calendar) { | |
$event = $datetime_in_calendar->event(); | |
$categories = $event->get_all_event_categories(); | |
foreach( $categories as $category ) { | |
if( $category->name() == 'Private' ) { | |
return 'Venue Booked'; | |
} | |
} | |
return $original_title; | |
} | |
add_filter( 'FHEE__EE_Datetime_In_Calendar__to_array_for_json__title', 'tw_ee_EE_Datetime_In_Calendar__to_array_for_json__title', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment