If you want to let users know that their accounts are still pending, you can use this snippet:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Display notice to user if their account is pending | |
*/ | |
function prefix_check_user_role() { | |
if( wc_current_user_has_role( 'pending' ) ) { | |
wc_add_notice( | |
'Your account is still pending', | |
'notice' | |
); | |
} | |
} | |
add_action( 'init', 'prefix_check_user_role' ); |
Here’s how to add the snippet.