Hide/Show registration button on specific events

Hide/Show registration button on specific events

Not all your events require a Registration Button/ tab. For such events users can hide the registration button in WP Event Manager.

There are certain events for which organizers do not want people to register and this is when they need to hide the registration button.

Here are the steps that need to be followed to show or hide the registration button for specific events:

The below-mentioned code is used in the Functions.php file of the child theme to disable or enable the Registration tab for specific events.

  1. Open your child theme function.php.
  2. Add this following code:
  1. /**
  2.  * registration_limit_restriction
  3.  * @param $method,$post
  4.  * @return $method
  5.  * @since 3.1.11
  6.  */
  7. function your_child_theme_registration_disable($method,$post){
  8.     $disable_button = get_post_meta($post->ID,'_show_hide_registration_button',true);     
  9.     //disable button if settings in event meta box
  10.     if( $disable_button == 1){
  11.          return false;
  12.     }else{
  13.         return $method;
  14.     }
  15. }
  16. add_filter('display_event_registration_method','your_child_theme_registration_disable',90,2);
  17. add_filter('get_event_registration_method','your_child_theme_registration_disable',90,2);  
  18. add_filter( 'submit_event_form_fields', 'show_hide_registration_button' );
  19. function show_hide_registration_button( $fields) {        
  20.     $fields['event']['show_hide_registration_button'] =  array(
  21.                                         'label'       => __( 'Show Hide Registration Button', 'wp-event-manager-registrations' ),
  22.                                         'type'        => 'checkbox',
  23.                                         'required'    => false,
  24.                                         'priority'    => 22,
  25.                                    );    
  26. return $fields;
  27. }

Please note after adding the code, there will be an Enable/disable Registration box on the right hand sidebar. This will help you enable and disable the registration button on the event detail page.


    • Related Articles

    • 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 ...
    • 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 ...
    • Recurring Events

      The Recurring Events Plugin is one of the most useful plugins offered by WP Event Manager. It helps users conduct recurring events automatically with additional options to streamline the entire management process. With the plugin, your recurring ...
    • Export Events

      The WP Event Manager’s Export Events plugin allows you to export all the event data through CSV files. Installing The Plugin The installation process is the same for all the addons, offered by WP Event Manager. They can be both installed ...
    • 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 ...