#2888 closed enhancement (fixed)
New function to reset vars
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 2.1 | Priority: | normal |
Severity: | normal | Version: | 2.1 |
Component: | Optimization | Keywords: | bg|has-patch bg|needs-testing |
Focuses: | Cc: |
Description
Most files in wordpress/wp-admin/*.php start with 15-lines-code to reset vars in an array. So, just move this code to new function and put it in admin-functions.php. This is better than write same code in +10 files.
In the patch i used $_REQUEST because it contain both of $_POST and $_GET, this will offer some lines. Also, the var unseted according to #2595.
Also, isn't "foreach" better than "for"? or at least more cleaner?
Attachments (2)
Change History (9)
#1
@
19 years ago
- Keywords bg|has-patch bg|needs-testing added
- Owner changed from anonymous to Sewar
#4
@
19 years ago
I've been wanting to do this for some time but never got around to it. Committed, thanks. A nice followup patch would be to audit the vars and remove those that are no longer relevant.
#5
@
19 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
The new patch is for comment.php file, i forget to merge it in the first patch. i just seen that it wasn't merged after updating SVN. Sorry for this.
Ha! I was just planning on doing this today. Nice work :)