Posted: March 29, 2018 at 12:51 am
|
I am using wp user integration plugin for event Espresso and I have applied settings like this: Force Login For Registration: Yes This is all working fine Except when user Login via Registration checkout form (EE process), the information of user information get’s displayed on a registration form. But actually, WordPress site does not know if a user is logged in or not since you are not refreshing the Page(AJAX). How do I refresh a page after a user gets logged in? |
Hi there, We don’t refresh the page as we already do an AJAX request to log the user in, WordPress knows the user is logged in, it just doesn’t show it on that specific page without reloading it as the login is done on another request (the AJAX request). As far as EE is concerned the user is logged in, it doesn’t need the rest of the page to show the user is logged in and will continue to work, can I ask why you need the page to refresh? |
|
|
I am loading My Custom JS Script on AHEE__Single_Page_Checkout___initialize_reg_step__wpuser_login hook. Also inside the function call, I’m checking if a user is logged in or not for enqueuing Script. |
Hi there, The hook to load JS most WordPress developers recommend is the https://developer.wordpress.org/reference/hooks/wp_enqueue_scripts/ http://www.wpbeginner.com/wp-tutorials/how-to-properly-add-javascripts-and-styles-in-wordpress/ |
|
|
Okay, here’s my code. $parentChildren = get_user_meta($parent->ID, ‘wdm_child_info’, 1); wp_register_script(‘wdmEERegisterJS’, plugins_url(‘/assets/js/wdmEERegisterValidation.js’, __FILE__), array(‘jquery’), ‘1.2.0’, true); IMP: I just Wanted to reload that page after ajax call. Is there a way |
I’m afraid your code makes no sense to me, but I can point out that the correct usage of the wp_enqueue_scripts action hook would look like this:
Then you’ll probably need to add some logic within your callback function to ensure the code executes only when needed. For example:
|
|
The support post ‘JS script is not loading after logged in?’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.