I need to run a code snippet if the user registration is allowed, but I can't find a solution. How to do this?
1 Answer
You can check it very easily with the help of get_option.
Here is a simple code for checking if user registration is allowed.
if ( get_option( 'users_can_register' ) ) {
// Your custom code or message to display if user registration is allowed.
}
get_option( 'users_can_register' )
returns boolean true (1) or false (0).
wp-admin
and if you are trying to spam other's website then I think this is not the right place to ask such question.