Opened 3 years ago
Last modified 3 years ago
#11598 new enhancement
code improvements in wp_:dashboard_plugins_output()
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Future Release |
| Component: | General | Version: | 2.9 |
| Severity: | normal | Keywords: | has-patch |
| Cc: |
Attachments (2)
Change History (10)
comment:3
follow-up:
↓ 6
dd32
— 3 years ago
- Keywords tested removed
Does that do {} while(false); loop work? That will only ever run once from looking at the code.
Continue will just skip the rest of the loop and go straight to the conditional.
Best to leave it as a while(true) { break;} , Theres no need for the do syntax which is out of line with the rest of WordPress
comment:4
Denis-de-Bernardy
— 3 years ago
- Keywords needs-patch added; has-patch removed
comment:5
nacin
— 3 years ago
- Milestone changed from 3.0 to 3.1
- Type changed from defect (bug) to enhancement
comment:6
in reply to:
↑ 3
hakre
— 3 years ago
Replying to dd32:
Does that do {} while(false); loop work? That will only ever run once from looking at the code.
Yes/Yes: Yes, it does work. Second yes is clear I guess. Let me know if not.
Best to leave it as a while(true) { break;} , Theres no need for the do syntax which is out of line with the rest of WordPress
Will adopt the patch accordingly to that feedback.
comment:7
hakre
— 3 years ago
- Keywords has-patch added; needs-patch removed
- Changed the patch according to dd32 feedback regarding the do/while clause.
- Used in_array() to check for installed slugs instead of the reset/foreach combo[sic!] that is currently in there. Let me know if that's ok or not (that was with substr() compare but I assumed that this implicated problems as well).
- Description filter is put next to the other filters.
- Removed unnecessary isset() check after the while(true) loop.
- Added comments
- Formatted the code according to the styleguide
I have this running on my testbed against current trunk with no probs.
Tested against current trunk, Plugin listing works flawlessly.