Events+ & Membership2

Does anyone know of a way to have users rerouted to the Membership 2 registration page upon clicking the "I'm attending" button in an Event?

I've set up Membership 2 in order to restrict users from the backend of the site. However, the Event's pages are still rerouting users to the regular WP registration page instead of the Membership 2 registration page.

Thanks in advance!

  • Lindeni Mahlalela
    • Recruit

    Hello Soto Web Studios

    I hope you are doing great today. I am really sorry for the delayed response from our end. I would like to thank you for all your patience while we were looking into this.

    I have checked the single event page and noticed it has references of the wp-login.php in the redirect url and I have created the following code to change the url to which users will be redirected when they need to register.

    You can simply place this code in your theme's functions.php file or create a new file and uploud it to your website in the folder 'wp-content/mu-plugins':

    add_action("wp_footer", "change_events_plus_redirect_link", 10 );
    function change_events_plus_redirect_link(){ ?>
    <script type="text/javascript">
    		jQuery(".wpmudevevents-yes-submit, .wpmudevevents-maybe-submit, .wpmudevevents-no-submit").each( function(){
    			var login_link = jQuery(this).attr("href").valueOf();
    			/** replace membership with relevant slug for membership login page **/
    			var new_login_link = login_link.replace("wp-login.php","membership/");
    		jQuery(".wpmudevevents-buttons").bind("DOMSubtreeModified", function(){
    			if ( jQuery("#eab-rsvps-rsvp_with_email-wrapper").length ) {
    				var login_link = jQuery("#eab-rsvps-rsvp_with_email-wrapper span a").attr("href").valueOf();
    				var new_login_link = login_link.replace("wp-login.php", "memmbership/");
    				jQuery("#eab-rsvps-rsvp_with_email-wrapper span a").attr("href", new_login_link);
    <?php }

    In this code you need to consider changing the 'membership/' with the slug of the login/registration page of Membership plugin. It should work as it is but maybe I have missed something. In my test this code does change the link to wp-login.php with the one specified. I haven't done any thorough testing after that, so please test it and let us know if you run into any issues and we will be happy to help in any way possible.

    I hope this helps. Please let us know if you need help with anything else.

    Have a nice day.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.