Event+ RSVP shortcode or way to output RSVP button for specific event

I want to output a RSVP button for specific event on this page: https://creatorup.com/awesomenesstv-channel-boost-camp/

Right now, I used the php code like this:

echo Eab_Template::get_rsvp_form($post_objects);

And it works and output a RSVP links - Yes/Maybe/No

But when I click the button, it redirect me to the single event page with the option I pick.

But instead, I want it to say "Thank You" or behave like single event page does - highlight the option without redirect, or show the RSVP list. Is there a short code of php code to do that?

  • Tyler Postle

    Hey Hugh!

    This is a cool idea :slight_smile: this would require further custom coding to achieve, there is no shortcode available for it. I will flag one of our SLS(coding experts) here so we can get their valuable opinion.

    In the meantime, another workaround would be to bring in the full event using the:

    [eab_single id="5"] then hiding everything with CSS except the rsvp button :slight_smile:

    Hope this helps!

    Keep in mind SLS deal with more complex threads so their response times can be a little slower than normal. In the meantime, let me know if you have any further questions on this.

    All the best,
    Tyler

  • Hoang Ngo

    Hi @hughred22,

    I hope you are well today.

    I assume that you are using the event from Events+ plugin. So for display the notification message, you will need to add this code above your current code
    <?php echo Eab_Template::get_error_notice() ?>
    This will check the request and display the right notification message.

    If you have any issues please don't hesitate to let us know so we can assist

    Best regards,
    Hoang Ngo

  • Hoang Ngo

    Hi @hughred22,

    I hope you are well today.

    If that, we will need to have some custom code, Please add this code to your theme functions.php or use mu-plugins

    function get_rsvp_form_ext ($post) {
    	global $current_user;
    	$event = ($post instanceof Eab_EventModel) ? $post : new Eab_EventModel($post);
    
    	$content = '';
    	$content .= '<div class="wpmudevevents-buttons">';
    
    	if ($event->is_open()) {
    		if (is_user_logged_in()) {
    			$booking_id = $event->get_user_booking_id();
    			$booking_status = $event->get_user_booking_status();
    			$default_class = $booking_status ? 'ncurrent' : '';
    
    			$content .= '<form action="' . get_permalink(get_the_ID()) . '" method="post" id="eab_booking_form">';
    			$content .= '<input type="hidden" name="event_id" value="' . $event->get_id() . '" />';
    			$content .= '<input type="hidden" name="user_id" value="' . $booking_id . '" />';
    			$content .= apply_filters('eab-rsvps-button-no',
    				'<input class="' .
    				(($booking_id && $booking_status == 'no') ? 'current wpmudevevents-no-submit' : 'wpmudevevents-no-submit ' . $default_class) .
    				'" type="submit" name="action_no" value="' . __('No', Eab_EventsHub::TEXT_DOMAIN) .
    				'" />',
    				$event->get_id()
    			);
    			$content .= apply_filters('eab-rsvps-button-maybe',
    				'<input class="' . (($booking_id && $booking_status == 'maybe') ? 'current wpmudevevents-maybe-submit' : 'wpmudevevents-maybe-submit ' . $default_class) .
    				'" type="submit" name="action_maybe" value="' . __('Maybe', Eab_EventsHub::TEXT_DOMAIN) .
    				'" />',
    				$event->get_id()
    			);
    			$content .= apply_filters('eab-rsvps-button-yes',
    				'<input class="' . (($booking_id && $booking_status == 'yes') ? 'current wpmudevevents-yes-submit' : 'wpmudevevents-yes-submit ' . $default_class) .
    				'" type="submit" name="action_yes" value="' . __('I\'m attending', Eab_EventsHub::TEXT_DOMAIN) .
    				'" />',
    				$event->get_id()
    			);
    			$content .= '</form>';
    		} else {
    			$login_url_y = apply_filters('eab-rsvps-rsvp_login_page-yes', wp_login_url(get_permalink($event->get_id())) . '&eab=y');
    			$login_url_m = apply_filters('eab-rsvps-rsvp_login_page-maybe', wp_login_url(get_permalink($event->get_id())) . '&eab=m');
    			$login_url_n = apply_filters('eab-rsvps-rsvp_login_page-no', wp_login_url(get_permalink($event->get_id())) . '&eab=n');
    			$content .= '<input type="hidden" name="event_id" value="' . $event->get_id() . '" />';
    			$content .= apply_filters('eab-rsvps-button-no',
    				'<a class="wpmudevevents-no-submit" href="' .
    				$login_url_n .
    				'" >'.__('No', Eab_EventsHub::TEXT_DOMAIN).'</a>',
    				$event->get_id()
    			);
    			$content .= apply_filters('eab-rsvps-button-maybe',
    				'<a class="wpmudevevents-maybe-submit" href="' .
    				$login_url_m .
    				'" >'.__('Maybe', Eab_EventsHub::TEXT_DOMAIN).'</a>',
    				$event->get_id()
    			);
    			$content .= apply_filters('eab-rsvps-button-yes',
    				'<a class="wpmudevevents-yes-submit" href="' .
    				$login_url_y .
    				'" >'.__('I\'m Attending', Eab_EventsHub::TEXT_DOMAIN).'</a>',
    				$event->get_id()
    			);
    		}
    	}
    
    	$content .= '</div>';
    
    	$content = apply_filters('eab-rsvps-rsvp_form', $content, $event);
    
    	return $content;
    }

    And then, you can use it to call the form content, example like this
    <?php echo get_rsvp_form_ext(get_the_ID()); ?>
    Instead of the old way
    <?php echo Eab_Template::get_rsvp_form() ?>
    Please give it a try and let us update :slight_smile:

    Best regards,
    Hoang Ngo

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.