Opened 14 years ago
Closed 14 years ago
#21071 closed enhancement (fixed)
Do a load action in admin.php for importers
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 3.5 | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Import | Keywords: | has-patch commit |
| Focuses: | Cc: |
Description
Every type of page in the admin area has an equivalent load-[whatever] type action, which is triggered before any HTML has been rendered. This is handy if a plugin needs to process some data which might require a redirect header to be set, or to affect HTML which is rendered before the admin screen main content (e.g. admin notices).
The exception to the rule is the importers. I propose adding an action which would allow plugins and themes to execute code at this point as easily as they can in other areas of WP admin.
Attachments (1)
Change History (8)
#2
@
14 years ago
- Keywords commit added; dev-feedback removed
- Milestone changed from Awaiting Review to 3.5
I think 'load-importer-' is a good precaution.
#3
@
14 years ago
I can go for something like this. Not sure if I like the idea of modeling it after "load-*", as those hooks are specifically acting on $hook_suffix, while in this case the hook suffix would be "admin.php". Either way, namespacing it so it is load-importer-$importer or "import_$importer" or "load_importer_$importer" seems good to me.
#4
@
14 years ago
I chose load-importer-$importer as it indicates the similarity with the other load-$whatever hooks. Personally I favour dashes in hooks, and again this would be consistent with the other load-$whatever hooks.
#5
follow-up:
↓ 6
@
14 years ago
I am satisfied with the use case presented here as well as 21701-sw-1.diff. Leaving this for duck_ and westi to weigh in.
Diff adds
do_action("load-importer-$importer");intoadmin.phpwithin this block of the conditional where the other load actions are triggered. The use of "load-importer" rather than "load-" is to get around the possible problems of having a plugin page hook which clashes… but perhaps I'm wrong or overly concerned?