Support » Plugin: Events Manager – Event Cancellation » Why’s there a category “cancelled”?

  • Resolved eddypiv

    (@eddypiv)


    Hi,

    Trying out your plugin, and try to understand why there is now a category “cancelled”.
    As the trigger for the cancellation process is not the category, but the post status (“cancelled”), and that works well (thanks for that, good job!), why this category?

    In the advanced search there is now this category in the dropdown list.
    I would like to have it removed from this list, as it results in “No events”, but also in the event editing function in the WordPress area I find it confusing.

    Eager to hear your explanation.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Stonehenge Creations

    (@duisterdenhaag)

    Hi @eddypiv,
    Thank you for trying this plugin.

    The custom post status keeps the event status at 1 to keep existing bookings. Events Manager deletes all bookings data if an event is set to status 0. And then you would not be able to notify them by email anymore…

    The post status is also used to change the status to “Draft” if you deactivate this plugin for any reason, preventing orphaned events. When you reactivate this plugin, it will automatically loop through draft events and uses the event category “event-cancelled” to determine whether or not change the post status to “Cancelled” again.

    The event category is there for several reasons, but also to allow exclusion. It gives you the option to show or hide cancelled events to your visitors.

    Within Events Manager there are two ways to exclude event categories from the front-end, by using shortcodes or by editing a template file. Events Manager shortcodes are easier to use, because they overrule the default settings.

    Looking at your website, I assume you enabled the events search using the Events Manager settings. If so, you need to make a minor change in the template file, because Events Manager does not exclude or hide specific categories by default or settings.

    The easiest way would be to:

    • Disable the search form in the Events Manager settings.
    • Then lookup the Category ID for ‘event-cancelled’ in Events > Event Categories.
    • Go to your Events Page in Dashboard > Pages.
    • Paste the shortcode [event_search_form hide_empty=1 category="-14"] above “CONTENTS”, where 14 is your Category ID for ‘event-cancelled’.

    If you are comfortable to edit template files you could use the snippet that the Events Manger devs documented on their Pastebin.

    Let me know if you need help editing their template.

    Thread Starter eddypiv

    (@eddypiv)

    Hi,

    Thanks for your quick and extensive response. Much appreciated.

    The function of the category is clear now.

    I have done as you suggested.
    The page (../evenementen/) now contains:
    [event_search_form hide_empty=1 category=”-81,-108″]
    CONTENTS
    However the events page as well as the advanced search filter still contain the ‘event-cancelled’ category (ID=108).

    Actually, there is another category (‘flexplek’, ID=81) of a complete different nature, to be treated in a complete different way. It therefor needs to be excluded as well from the filter list as well as from the events page.
    But both still appear in the page and the filter.
    So how to exclude them from the search filter as well as from the default events page?

    I created a new page (../evenementen-2/) with
    [event_search_form hide_empty=1 category=”-81,-108″]
    [events_list_grouped mode=”monthly” limit=”10″ category=”-81,-108″ pagination=”1″]
    …..
    [/events_list_grouped]
    Events from both categories are now excluded from the listing, but not from the search filter.

    So how to get these categories excluded from the events page and from the search filter?
    Can you help me with that, please?

    • This reply was modified 2 months ago by eddypiv.
    Plugin Author Stonehenge Creations

    (@duisterdenhaag)

    It appears that the search shortcode does not accept these search arguments.
    Then you/we need to use the custom template after all.

    To keep custom coding safe from plugin updates, you need to copy the original template file to your theme directory using the same directory path as the original file. (Official Events Manager documentation)

    That comes down to:

    • Using FTP or the Files Manager in cPanel, go to /wp-content/themes/your-theme/.
    • Create these folders: /plugins/events-manager/forms/event.
    • In the event folder, create a new file: categories-public.php

    Then paste this snippet in categories-public.php

    
    <?php $args = !empty( $args ) ? $args : array(); /* @var $args array */ ?>
    <!-- START Category Search -->
    <div class="em-search-category em-search-field">
      <label>
        <span><?php echo esc_html($args['category_label']); ?></span>
        <?php
        EM_Object::ms_global_switch(); //in case in global tables mode of MultiSite, grabs main site categories, if not using MS Global, nothing happens
        wp_dropdown_categories( array (
          'hide_empty' => true,
          'orderby' =>'name',
          'name' => 'category',
          'hierarchical' => true,
          'taxonomy' => EM_TAXONOMY_CATEGORY,
          'exclude' => '81,108',
          'selected' => $args['category'],
          'show_option_none' => $args['categories_label'],
          'option_none_value'=> 0,
          'class'=>'em-events-search-category'
        ) );
        EM_Object::ms_global_switch_back(); //if switched above, switch back
        ?>
      </label>
    </div>
    <!-- END Category Search -->
    

    This snippet is an altered version of the Events Manger Pastebin link I posted in my previous reply. You can copy/paste, as I put you category ID’s already in there.

    Thread Starter eddypiv

    (@eddypiv)

    Hi,

    Took a few days for me to respond.
    After all I decided it’s better to have the events for flexible workspaces in a separate subsite, as the nature and treatment is so different from the other events.
    Plus, the number of occurrences for the flexplek would be significantly higher than the other events, slowing their listing down considerably.

    Thanks for your help and quick and extensive responses.

    Take care!

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.