Created
October 20, 2020 11:49
-
-
Save plugin-republic/6f39b5f74724b40ae699135da3db2bf2 to your computer and use it in GitHub Desktop.
Display notice to user if their account is pending
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' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment