Create user hashing the password according to WP rules#426
Create user hashing the password according to WP rules#426
Conversation
|
This works great! Just a note on your warning above that may confuse people: You can still keep the Laravel Auth and WP Auth separate (even have separate register/login forms for each). Just differentiate them via namespacing: Register form for WP is for authors/moderators etc Can we get this merged 👍 |
|
In all honesty I am not sure how to achieve adding meta when creating a new user. Would this not be down to whomever creates the user to save the meta?
|
|
@brittainmedia yep, that's the point, using |
|
Okay... There doesn't seem to be an easy way to give explicit examples for what each meta value should be. Most of the meta fields have filters associated with the values. Additionally the options available for each are dynamic and based on various other database values within wp_options. See: https://github.com/WordPress/wordpress-develop/blob/master/src/wp-includes/user.php#L1446 |
|
+1 here, doing this by hand |
|
how can i set woocomerce details and also user first_name and last_name? |

WP uses a different password hashing algorithm than Laravel does. This PR adds a
UserObserverclass to fill required fields and aUser@setUserPassAttribute()method to hash the password according to WP rules.Now you can create users on the fly. The required params are
user_login,user_passanduser_email. Others are filled by default and the password is hashed by default.TODO