Support » Plugin: Login/Signup Popup ( Inline Form + Woocommerce ) » using multiple redirects

  • randallishino

    (@randallishino)


    Hello,

    I’m using the popup on multiple different parts of the website, I need it to be able to redirect users to a specific page after creating an account / registering. The main purpose is controlling locked content. How can I differentiate all the popups? Or create a specific one for each situation so each one can lead to a different redirect.

Viewing 1 replies (of 1 total)
  • xootixsupport

    (@xootixsupport)

    Hello @randallishino

    Wrote this snippet, its a if/else statement based on your page Ids.
    add this to your functions.php

    //Update redirect url
    function xoo_cu_el_update_gl_option( $gl_options ){
    
    	remove_filter('pre_option_xoo-el-general-options', 'xoo_cu_el_update_gl_option');
    
    	$gl_options = get_option('xoo-el-general-options');
    	
    	$login_redirect = $gl_options['m-login-url'];
    	$reg_redirect   = $gl_options['m-redirect-url'];
    
    	//Login redirect url on page id
    	if( is_page(6) ){
    		$gl_options['m-login-url'] = "http://url.com";
    		$gl_options['m-redirect-url'] = "http://url.com";
    	}
    	elseif( is_page(7) ){
    		$gl_options['m-login-url'] = "http://url1.com";
    	}
    	elseif( is_page(8) ){
    		$gl_options['m-login-url'] = "http://url2.com";
    	}
    	else{
    		//For all other pages
    	}
    
    	return $gl_options;
    
    }
    add_filter('pre_option_xoo-el-general-options', 'xoo_cu_el_update_gl_option');
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.