Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter randmanrjr

    (@randmanrjr)

    Our custom theme has the the jQuery Fancy Box library included for some theme functionality. However, just including jQuery Fancy Box should not create an issue. This sounds like there is an issue with event triggering in the Draw Attention code vice an issue with another plugin or theme including jQuery Fancy Box. Are you initializing event handlers for jQuery Fancy Box that don’t have any type of conditional checks?

    Thread Starter randmanrjr

    (@randmanrjr)

    Hi there, just checking in to see if there is a fix for this transient issue.

    Thread Starter randmanrjr

    (@randmanrjr)

    Here is my final code to automatically delete past recurring events.

    The job is scheduled hourly to ensure that the number of past events is not too large.

    It deletes past events that are older than two days old out to a week.
    If it is run on schedule there really should not be any accumulation beyond 2 days old.

    I’ve also found it wise to set a limit on the number of events processed at any one time.

    I chose to have the events force deleted vs trashed for a more automated system.

    
    //automatically remove past recurring events from event manager
    
    function set_up_scheduled_event() {
        if ( !wp_next_scheduled( 'Delete_Past_Events' ) ) {
            wp_schedule_event( time(), 'hourly', 'Delete_Past_Events');
        }
    }
    add_action('wp', 'set_up_scheduled_event');
    
    add_action('Delete_Past_Events', 'actually_delete_past_events');
    
    function actually_delete_past_events() {
        global $EM_Event;
        $weekago                = date('Y-m-d', strtotime("-7 day"));
        $day_b_for_yesterday    = date( 'Y-m-d' , strtotime("-2 day"));
        $past_events            = EM_Events::get(array(
            'scope'     => $weekago . ',' . $day_b_for_yesterday,
            'limit'     => 100
        ));
        foreach ($past_events as $event) {
            if ($event->recurrence_id) wp_delete_post($event->post_id, true); // only delete if it's been produced by a recurrent event
        }
    }
    
    • This reply was modified 7 years, 6 months ago by randmanrjr.
    Thread Starter randmanrjr

    (@randmanrjr)

    I manually removed all of past events from the wp-admin dashboard. Now when running this script, I am getting the newly past events, and they all have post_id’s

    Not sure what the hiccup was.

    Thread Starter randmanrjr

    (@randmanrjr)

    Here is the top part of the output for the event when retrieved by EM_Events::get() using the ‘post_id’ for a specific event.

    1 events
    Array
    (
    [0] => EM_Event Object
    (
    [event_id] => 58590
    [post_id] =>
    [event_slug] => circuit-training-lauren-2-2016-11-16
    [event_owner] => 6
    [event_name] => Circuit Training with Kellie
    [event_start_time] => 05:30:00
    [event_end_time] => 06:00:00
    [event_all_day] => 0
    [event_start_date] => 2016-11-16
    [event_end_date] => 2016-11-16
    [post_content] => No Registration Required!
    [event_rsvp] => 0
    [event_rsvp_date] => 2016-11-16
    [event_rsvp_time] => 00:00:00
    [event_rsvp_spaces] =>
    [event_spaces] => 0
    [event_private] => 0
    [location_id] => 29
    [recurrence_id] => 15188
    [event_status] => 1
    [blog_id] =>
    [group_id] => 0
    [event_attributes] => N;
    [recurrence] => 0
    [recurrence_interval] => 1
    [recurrence_freq] => weekly
    [recurrence_byday] => 3
    [recurrence_days] => 0
    [recurrence_byweekno] => 1
    [recurrence_rsvp_days] =>
    [event_owner_anonymous] =>
    [event_owner_name] =>
    [event_owner_email] =>

    Thread Starter randmanrjr

    (@randmanrjr)

    I’ve looked that the CF7 javascript. Looks like the validation is done on the server after the ajax submit. Validation errors are returned to the script and then the css classes of the inputs are updated.

Viewing 6 replies - 1 through 6 (of 6 total)