Home › Forums › Calendar Products › Events Calendar PRO › What is calling reoccuring events?
- This topic has 4 replies, 3 voices, and was last updated 9 years, 2 months ago by
Aaron Willey.
-
AuthorPosts
-
March 8, 2017 at 2:16 pm #1251364
Aaron Willey
ParticipantI am creating a custom widget plugin to present a single event that is reoccuring later in the day ie. 9:15AM and 11:15AM. I have set up my event and using:
$posts = tribe_get_events( apply_filters( ‘ecs_get_events_args’, array( $query ));
I am getting back 1 post. (correctly) I am building an output using:
$event_output .= apply_filters( ‘event_date_tag_start’, ‘<span class=”duration time”>’, $atts, $post ) .
apply_filters( ‘event_list_details’, tribe_events_event_schedule_details(), $atts, $post ) .
apply_filters( ‘ecs_event_date_tag_end’, ‘</span>’, $atts, $post );I am overriding using:
// removes the end time
function custom_tribe_events_event_schedule_details_formatting( $settings ) {
$settings = array(
‘show_end_time’ => false,
‘time’ => true,
);
return $settings;
}
add_filter( ‘tribe_events_event_schedule_details_formatting’,’custom_tribe_events_event_schedule_details_formatting’);The issue is:
The return has a reoccuring event somewhere in it that i cannot find to change. The output is currently:March 12 at 9:15 am
|Recurring Event (See all)
One event on an unspecified date at 11:15amI am hoping to get it in the form:
March 12 at 9:15 am and 11:15am.(and if no reoccuring event, omit the second time)
Is there another function or template that is setting the format?March 9, 2017 at 2:05 pm #1252017Barry
MemberHi Aaron,
Before calling tribe_events_event_schedule_details() you could first call the following method:
Tribe__Events__Pro__Main::instance()->disable_recurring_info_tooltip()
Afterwards, you could restore normal behaviour with:
Tribe__Events__Pro__Main::instance()->enable_recurring_info_tooltip()
These essentially toggle the addition of the Recurring Event (See All) link on and off. Does that help?
March 9, 2017 at 5:22 pm #1252118Aaron Willey
ParticipantI ended up using:
$dates = tribe_get_recurrence_start_dates(get_the_ID());
$firstdate = date(‘F jS \a\t g:i a’, strtotime($dates[0]));
if ($dates[1]) { // in case there is no second date
$firstdate .= date(‘ \a\n\d g:i a’, strtotime($dates[1]));
}
$event_output .= ‘<span class=”duration time”>’ . $firstdate . ‘</span>’;instead of:
apply_filters( ‘event_list_details’, tribe_events_event_schedule_details(), $atts, $post )its kind of a hack but works enough to get what i’m after.
I still needed the date so turning off the tool tip was only one step.
I may need that in the future though, thanks for the reply.March 9, 2017 at 5:43 pm #1252123Barry
MemberThanks for sharing the fix (and great to hear you’re all set) 🙂
-
AuthorPosts
- The topic ‘What is calling reoccuring events?’ is closed to new replies.
