Skip to content

Instantly share code, notes, and snippets.

@edisplay
Forked from jazbek/gist:6355989
Created September 24, 2015 16:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edisplay/08575936a444714ca7e0 to your computer and use it in GitHub Desktop.
Save edisplay/08575936a444714ca7e0 to your computer and use it in GitHub Desktop.
Add the recurrence schedule to the single event details
<?php
//
add_action('tribe_events_before_view','tribe_recurrence_schedule_meta');
function tribe_recurrence_schedule_meta(){
global $post;
// force this to run only on single event views
if( is_single() && tribe_is_event( $post->ID ) ){
if( tribe_is_recurring_event( tribe_is_recurring_event( $post->ID ) ) ) {
tribe_register_meta( 'tribe_recurrence_schedule', array(
'label' => 'Schedule:',
'meta_value' => tribe_get_recurrence_text($post->ID),
'group' => 'tribe_event_details'
) );
}
}
}
// add the new custom meta into the template keys for custom templates on single event views
add_action( 'tribe_events_single_event_meta_template_keys', 'custom_meta_keys');
function custom_meta_keys( $keys ){
$keys[] = 'tribe_recurrence_schedule';
return $keys;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment