Commit 6d9f8fa
committed
Users: Throw specific warning when
Modifies `wp_insert_user()` to throw the warning `The user_pass field is required when creating a new user. The user will need to reset their password before logging in.` when called without the `user_pass` argument defined.
This avoids a mix of warnings being thrown depending on the version of PHP the system is running on, anywhere between zero and three.
To retain backward compatibility the user is created with an empty password. As WordPress does not accept an empty password during authentication, this will require the newly created user complete the password reset process.
Props dd32, hbhalodia, iamadisingh, mindctrl, rollybueno, sheldorofazeroth, shilpaashokan94
Fixes #63770.
git-svn-id: https://develop.svn.wordpress.org/trunk@60650 602fd350-edb4-49c9-b593-d223f7449a82wp_insert_user() called without user_pass.1 parent 2ac68e9 commit 6d9f8fa
File tree
2 files changed
+14
-2
lines changed- src/wp-includes
- tests/phpunit/tests/user
2 files changed
+14
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2221 | 2221 | | |
2222 | 2222 | | |
2223 | 2223 | | |
| 2224 | + | |
| 2225 | + | |
| 2226 | + | |
| 2227 | + | |
| 2228 | + | |
| 2229 | + | |
| 2230 | + | |
| 2231 | + | |
| 2232 | + | |
| 2233 | + | |
| 2234 | + | |
| 2235 | + | |
2224 | 2236 | | |
2225 | 2237 | | |
2226 | 2238 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
157 | | - | |
| 157 | + | |
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
| |||
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
178 | | - | |
| 178 | + | |
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
| |||
0 commit comments