Opened 15 months ago
Last modified 9 months ago
#20279 new enhancement
Functions defined in wp-login.php should be moved to a separate file to make them re-usable
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | General | Version: | |
| Severity: | normal | Keywords: | has-patch |
| Cc: | wycks, emeraldimp, scott@…, zombrows |
Description
Currently, there are a series of functions defined at the top of wp-login.php:
login_header() login_footer() wp_shake_js() retrieve_password() check_password_reset_key() reset_password() register_new_user()
If these functions were moved to a separate file, they would be reusable by folks who are trying to do more advanced things involving the login flow.
As an example, if you want to create a page resembling wp-login right now, there's no easy way to do it without just duplicating everything from this file. Moving these functions means you can use login_header() and login_footer() to recreate the bulk of the page, then handle the "content block" yourself. This marginally improves the re-usability of the login system.
Patch attached which does this.
Attachments (1)
Change History (8)
beaulebens
— 15 months ago
comment:1
nacin
— 15 months ago
See also #15384. I think some of these functions are good as a separate file, while others are pretty intrinsic to the login skin/flow.
We don't use dotted filenames — those files are from BackPress. This would simply be wp-includes/login.php.
Also, 19852#comment:31, where we may end up moving wp-login.php to the admin pot for 3.4.
comment:2
wycks
— 15 months ago
- Cc wycks added
I was just looking at wp_shake_js and it looks strange there, all for cleaning this up a bit.
comment:3
emeraldimp
— 13 months ago
- Cc emeraldimp added
comment:4
scottconnerly
— 13 months ago
- Cc scott@… added
comment:6
scottconnerly
— 13 months ago
comment:7
adrian7
— 9 months ago
Me too waiting for this enhancement. Maybe moved to pluggable.php. Also retrieve_password and others taking values directly from $_POST should accept one or more parameters.
For now a solution for me was to fork these functions and put them in functions.php of my theme.
Dotted filename used only to match the other functions.*.php files in wp-includes. Feel free to change it.