Disable Automatic Login After Registration

When we enable customer registration on My Account page, We will know that when new user is register it’s automatically logged in .
it need to change when we need to manually approve each user.

In that case we have to stop this Programmatically.
we can simply use 'woocommerce_registration_auth_new_customer' filter for that.

 

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
add_filter( 'woocommerce_registration_auth_new_customer', '__return_false' );
add_filter( 'woocommerce_registration_auth_new_customer', '__return_false' );
add_filter( 'woocommerce_registration_auth_new_customer', '__return_false' );

 

Enjoy

Categories

Related Blogs

How to add ACF options pages and options sub page

To add Advanced Custom Fields (ACF) options pages and options sub-pages, you’ll need to have ACF Pro installed and activated on your WordPress site. ACF Pro allows you to create custom options pages where you can add settings, fields, and other configuration data.

Fetch WordPress Categories

Fetch wordpress categories Using inbuilt functions like get_categories(), wp_list_categories(), wp_dropdown_categories().