Attendee limit on registration addon

Attendee limit on registration addon

The tutorial guides you on how you can limit the number of registrations in the Registration addon.

Here are the steps you need to take:

1. There are two ways in which you can do this:

Firstly, you can add a new field called “Registration Limit” from the Field Editor in your backend.

b. You can add a new field in functions.php by following this tutorial: “Event submission form Documentation.”

After that, you can add the code mentioned below.

2. You can go to your functions file by following the given path:

yourprojectname\wp-content\themes\event-listing\functions.php

3. Create a Function

  1. add_filter('event_manager_registration_addon_form','custom_event_registration_form_addon',100);

4. Add the code:

  1. /**
  2. * @return boolean
  3. */
  4. function custom_event_registration_form_addon(){
  5.           $event_id = get_the_ID();
  6.           $args = apply_filters( 'event_manager_custom_event_registrations_args', array('post_type' => 'event_registration',
  7.           'post_status' => array_diff( array_merge( array_keys( get_event_registration_statuses() ), array( 'publish' ) ), array(
  8.           'archived' ) ),'ignore_sticky_posts' => 1,'posts_per_page' => '-1','post_parent' => $event_id
  9.           ) ); 
  10.          $the_query = new WP_Query( $args ); 
  11. //change the 5 to your limitation of attendee 
  12.          $registration_limit = get_post_meta($event_id,'_registration_limit',true);
  13. //_registration_limit is a field name
  14.          if($registration_limit >= 0 && $the_query->found_posts >= $registration_limit ){
  15. //if you want to show notice then you can keep below line otherwise remove.
  16.          echo '<div class="wpem-alert wpem-alert-warning">The registration for this event is full.</div>';
  17.      return false;
  18.      }
  19.      return true;
  20.  }
    • Related Articles

    • How To Install WP Event Manager Add ons

      WP Event Manager offers a huge number of addons that help you strengthen your WordPress site with some amazing and very useful event management features and functionalities. While installing a premium addon, you need to ensure that you already have ...
    • Registrations

      The Registration addon streamlines the entire registration process and also makes it easy for attendees to register for an event. It also allows the organizers and admins to manage the registration form and registration dashboard. Installing The ...
    • Attendee Information

      The Attendee Information plugin is used to collect the details of your attendees for each and every event submitted on your website. It gives users the option to select specific event fields for the specific events that attendees need to fill in when ...
    • Exporting Registrations

      The Registration tool offered by WP Event Manager, gives the complete list of potential attendees along with their details that they fill in during the registration process. With the Export Registration option, users can easily download the list of ...
    • Field restriction on the registration form without sell ticket and attendee information

      Registration is one such feature that enables the users/organizer to collect all the information of the attendee on the website itself, thus Field restriction is important to collect proper data. The information that is required by the organizer from ...