Delete event occurrences if Daily Event

WordPress Event Management, Calendars & Registration Forums General Question Delete event occurrences if Daily Event

This topic contains 4 replies, has 2 voices, and was last updated by  LucaWeb 11 years, 9 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #3700

    Hi Stephen,

    in my archive-event page i’d like to hide event occurences just if are “daily” occurrences, i tryied looking at “eo_delete_event_occurrences” documentation, but i’m not so good with code! Is it possible to do it? Have you some exemple of code to show me?

    Thanks
    Luca

    LucaWeb
    #3710

    eo_delete_event_occurrences() is for deleting dates from the database rather than not disabling them. Unfortunately it’s currently not possible to query events by their schedule.

    However you can ‘group events’ – which means you only display the next occurrence of an event – rather than all of them – if that’s of any use!

    Stephen Harris
    #3716

    Hi Stephen,

    yes that could be of any use, is there a function that i can insert in my archive-event.php?

    I had a look and found something on the web, but i didn’t undestant to much!

    txs

    LucaWeb
    #3719

    In the while i solved my issue in the following way, so i share it maybe can be helpful:

    for daily events i just set a different “end” event (i consider it as a single event that lasts several days), in this way the plugin don’t consider it as an event with reoccurences and i don’t need to hide occurences,

    for to differentiate the date format from an one day event i used the following code:

    $start_date = eo_get_the_start(‘l j F Y’);
    $end_date = eo_get_the_end(‘l j F Y’);
    if($start_date == $end_date){
    //Event starts and ends on the same day
    echo ‘This event is from ‘.eo_get_the_start(‘jS M Y g:i a’).’ until ‘.eo_get_the_end(‘g:i a’);

    }else{
    //Event spans multiple days
    echo ‘This event is from ‘.eo_get_the_start(‘jS M Y g:i a’).’ until ‘.eo_get_the_end(‘jS M Y g:i a’);
    }

    LucaWeb
    #3727

    A little help, i’m now trying to show also the message using the code above, but something is wrong, i changed the code in this way

    $today = ‘today’;
    $start_date = eo_get_the_start(‘l j F Y’);
    $end_date = eo_get_the_end(‘l j F Y’);
    if($end_date < $today){
    echo ‘Event finish ‘.eo_get_the_start(‘l j F Y’).’ alle ore ‘.eo_get_the_start(‘H:i’);
    }elseif($start_date == $end_date){
    //Event starts and ends on the same day
    echo ‘Event start ‘.eo_get_the_start(‘l j F Y’).’ alle ore ‘.eo_get_the_start(‘H:i’);
    }else{
    //Event spans multiple days
    echo ‘Event from ‘.eo_get_the_start(‘l j F Y’).’ a ‘.eo_get_the_end(‘l j F Y’);
    }

    LucaWeb
Viewing 5 posts - 1 through 5 (of 5 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.