What is calling reoccuring events?

Home Forums Calendar Products Events Calendar PRO What is calling reoccuring events?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1251364
    Aaron Willey
    Participant

    I 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:15am

    I 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?

    #1252017
    Barry
    Member

    Hi 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?

    #1252118
    Aaron Willey
    Participant

    I 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.

    #1252123
    Barry
    Member

    Thanks for sharing the fix (and great to hear you’re all set) 🙂

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘What is calling reoccuring events?’ is closed to new replies.