• Resolved ximenavin

    (@ximenavin)


    Hi,

    I need users to log in or create an account before they can register for an event. How can I do that?
    Regards.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author roundupwp

    (@roundupwp)

    Hey ximenavin,

    Restricting registration for logged-in users is a feature available in the paid “Pro” version.

    Otherwise, you can put together a quick snippet to do this in the free version as well. Take a look at this FAQ: https://roundupwp.com/codex/action-rtec_before_display_form/

    Basically you need to add this to the functions.php file for your theme:

    function ru_filter_event_meta( $event_meta ) {
    
    	if ( ! is_user_logged_in() ) {
    		$event_meta['registrations_disabled'] = true;
    	}
    
    	return $event_meta;
    }
    add_filter( 'rtec_event_meta', 'ru_filter_event_meta' );
    
    function ru_show_log_in_message( $args ) {
    
    	if ( $args['event_meta']['registrations_disabled'] && ! is_user_logged_in() ) {
    		echo '<p class="rtec-success-message tribe-events-notices"><strong>Please log in to register</strong></p>';
    	}
    
    }
    add_action( 'rtec_before_display_form', 'ru_show_log_in_message' );
    Plugin Author roundupwp

    (@roundupwp)

    Hello again,

    Were you able to get something working? I’ll mark this as resolved but let me know if you have more questions!

    – Craig

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Mandatory Login’ is closed to new replies.