New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create user hashing the password according to WP rules #426
base: 2.7
Are you sure you want to change the base?
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 |
WP uses a different password hashing algorithm than Laravel does. This PR adds a
UserObserver
class 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_pass
anduser_email
. Others are filled by default and the password is hashed by default.TODO