Event Organiser Pro 1.8.0

1.8.0 was released today. There are lot of bug fixes and minor improvements, but predominantly there has been a major change in the booking form (described). This is effectively “part 2” of a two-part -major revamp of booking form handling which start in 1.7.0.

A full list of changes can be found in the change log.

Booking form changes

In 1.8 the booking form template is changing. This is to accommodate the fact the bookee name & email fields, and the submit button are now moving to inside the booking form customiser.

This allows you to position and configure them from there. The whys and wherefore can be found on this blog post. If you’ve edited the booking for template, you’ll need the few changes you need to make on that page.

The log-in form (if you have configured it to appear) has also changed. It no longer sits along side the bookee’s name/email details, but at the top and is initially hidden. The purpose of this is twofold:

  • Help the form lend itself to responsive themes
  • Minimise the number of form fields initially shown to the user

Additionally, along with the moving of the fields, a few field classes have been changed/added with view of consistency.

  • Added .eo-booking-field-checkbox-list class to checkbox elements
  • Sublabels in fields are given the class .eo-booking-sub-label.
  • Added .eo-booking-field-gateway class to gateway selection fields. Removed <br> tag

In the vast majority of cases these won’t be affect users. However you’d advised to check your booking forms after upgrading.

Added actions and filters

The actions eventorganiser_delete_booking_ticket and eventorganiser_deleted_booking_ticket have been added. These are triggered when tickets in a booking are deleted. One just prior the ticket’s removal from the database, and one immediately after.

The filter eventorganiser_booking_tickets_table and the action eventorganiser_booking_tickets_table_column have been added. This enables third-party plug-ins to add/remove/edit columns on the bookings admin table.

Booking field classes filter (& Bootstrap compatibility)

The filter eventorganiser_booking_element_classes has been added. This allows you to add classes to booking form fields.

Although this doesn’t mean the booking form will be Bootstrap compatible (by which I mean the fields look like the bootstrap fields), you can add the appropriate classes. Along with other filters, you can quickly make Pro integrate with a bootstrap-based theme.

For example:

/**
 * Assign appropriate default classes to error notices
 */
function mytheme_booking_error_classes( $class, $form ){
    $class .= ' alert alert-danger';
    $class = implode( ' ', array_unique( explode( ' ', $class ) ) );
    return $class;
}
add_filter( 'eventorganiser_booking_error_classes', 'fringetheme_booking_error_classes', 10, 2 );


/**
 * Assign appropriate default classes to notices
 */
function mytheme_booking_notice_classes( $class, $form ){
    $class .= ' alert alert-info';
    $class = implode( ' ', array_unique( explode( ' ', $class ) ) );
    return $class;
}
add_filter( 'eventorganiser_booking_notice_classes', 'mytheme_booking_notice_classes', 10, 2 );


/**
 * Assign appropriate default classes to form elements
 */
function mytheme_booking_element_classes( $class, $element ){
    $ignore = array( 'html', 'hidden', 'fieldset', 'terms_conditions', 'hook', 'section', 'button' );
    if( !in_array( $element->type, $ignore ) ){
        $class .= ' form-control ';
        $class = implode( ' ', array_unique( explode( ' ', $class ) ) );
    }
    return $class;
}
add_filter( 'eventorganiser_booking_element_classes', 'mytheme_booking_element_classes', 10, 2 );

Improved e-mail tags

The %event_date% e-mail tag now allows you to specify a date and time format. When used in an e-mail template %event_date will display the date of the event booked for using the date format set in Settings > General. When used %event_date{format}%, the date of the event is displayed with the specified format. Lastly %event_date{format}{time-format}% displays the event’s date with the two formats specified. The second format here is only used if the Event is not an all-day event. Typically this is used for the time:

`%event_date%` //14th August 2014
`%event_date{l, jS F Y}%` //Thursday, 14th August 2014
`%event_date{l, jS F Y}{ g:i a}%` //Thursday, 14th August 2014 9:30 am

Other API changes

  • Allow empty event searches with event search form.
  • $form->remove_element( $element_id ) removes nested elements too.
  • Added function eo_get_bookable_occurrences() to get occurrences that are ‘bookable’ (by default, furture occurrences).

Bug fixes

The following bug fixes have also been applied:

  • Used visibility rather than display to show/hide total rows. Stops a page potentially ‘jumping’ when a ticket is first selected.
  • Fixed bug where “sold out” message is displayed when the user has just had a booking confirmed (for the last ticket).
  • Fixed bug where using tax_query with “orderby distance” query returns no results.
  • Fixed bug where booking date is inaccurate after changing the blog’s timezone
  • Created eventorganiser_pro_get_booking_complete_message() to return “booking confirmed” message. Fixes bug where text is not translated.
  • Fixed bug where class attribute not being added to number inputs
  • Fixed bug with the min/max options of the number field
  • Fixed bug with non-escaped values in underscore templates (form customiser).
  • Escaped terms and conditions label
  • Added check for asp_tags (can cause issues with the form customiser).
  • Removed errant </div> from HTML returned by eo_get_event_search_form().