Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Can we give role parameter the value of pending in wp_insert_user ?

share|improve this question
    
This'll assign a custom role pending. –  amit Aug 10 '12 at 7:37
    
mean do i have to use add_role first ?? and if i have to then can you please tell me that i don't want to give any capability should i just leave the third parameter of add_role empty or anything else? –  PhpSeeker Aug 10 '12 at 7:49
    
yes, make a role called pending without third parameter $capabilities. and while using wp_insert_user() pass role as pending. –  amit Aug 10 '12 at 8:21

1 Answer 1

up vote 1 down vote accepted

You cannot set a value as pending ( left the role parameter blank ) to not enter a user role value into database using function - wp_insert_user().

See - wp-includes/user.php # L1363

NOTE -

wp_insert_user() function sets a default role if you do not provide any role parameter, So if you want to register a user without any capabilities, I think there's only way is register a new role called pending without capabilities and use it while calling wp_insert_user() functions.

share|improve this answer
    
Thanks mate it helped me alot –  PhpSeeker Aug 10 '12 at 9:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.