Opened 3 years ago
Last modified 2 years ago
#11469 new enhancement
Additional Admin UI hooks / filters
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Future Release |
| Component: | Administration | Version: | 2.9 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Denis-de-Bernardy, johnl1479, WordPress@…, mikeschinkel@…, ramiy, maorb |
Description
Some might classify this as overkill, others as making Wordpress as completely extendable as people want it.
I'd like to propose the addition of numerou hooks to the Wordpress core Admin UI which would allow the addition of UI elements outside of the current constraints, such as meta boxes.
If that doesn't make sense, I have an example to illustrate:
Given the "Subtitle" example from http://digwp.com/2009/10/ideas-for-plugins/, there would be a new hook named "edit_post_form_after_title" (or something along those lines) which would be placed directly after the post title is displayed on the screen and allow a plugin developer to insert a text field for a subtitle directly below the title field. See the attached patch.
Attachments (4)
Change History (24)
- Component changed from General to Administration
- Milestone changed from 2.9 to Future Release
- Keywords has-patch added
- Milestone changed from Future Release to 3.0
- Version set to 2.9
I like the Idea, but wouldn't it be more adviseable to add a filter for the main title input element so it can be changed / extended? Or at least to do these two changes in pair.
- Cc Denis-de-Bernardy added
Replying to hakre:
I like the Idea, but wouldn't it be more adviseable to add a filter for the main title input element so it can be changed / extended? Or at least to do these two changes in pair.
Yes, it probably would be a better idea to take that approach, I just threw that patch together to illustrate my point.
- Cc johnl1479 added
- Summary changed from Additional hooks to Additional Admin UI hooks / filters
I implemented this as a filter, per hakre's suggestion.
For 11469-3.diff you should use heredoc syntax.
comment:10
in reply to:
↑ 9
azaozz — 3 years ago
Perhaps this should be part of the UI changes for custom post types. Most of the "add/edit post" screen is already customizable (with the metaboxes), the three items remaining are the editor, title and JS permalink. They should probably be kept in one area (another metabox?) and new hooks added to each so plugins can add other elements there or disable/change them.
comment:11
nacin — 3 years ago
- Keywords needs-patch added; has-patch removed
Needs patch. Either we make it a meta box (+1), or the new patch should be written so we're not escaping quotes throughout. Heredoc would work, but it's not used anywhere in core, and there's nothing wrong here with using single quotes (either for PHP, or for the HTML attributes). (Also, _e() would need to become __().)
comment:12
follow-up:
↓ 18
johnl1479 — 3 years ago
Patch has been rewritten to use heredoc and single quotes (old habits die hard ;))
I like the idea of having each of those elements in a meta box like the rest of the elements on the screen (as in they can moved around as the user desires), however, I feel that it might be a little cluttered, and ultimately unnecessary to the see the collapsible headers current meta boxes have with the three vital elements to the screen
comment:13
nacin — 3 years ago
I think azaozz meant that the three elements could be added to a single meta box.
Also, what I meant by single quotes is:
$titlediv = "<div id='titlewrap'>";
$titlediv .= "\t<label class='screen-reader-text' for='title'>" . __('Title') . "</label>";
$titlediv .= "\t<input type='text' name='post_title' size='30' tabindex='1' value='" . esc_attr( htmlspecialchars( $post->post_title ) ) . "' id='title' autocomplete='off' />";
$titlediv .= "</div>";
Or reversed, using double quotes for HTML attributes, and single quotes for PHP strings. Both ways are acceptable WP coding standards.
comment:14
johnl1479 — 3 years ago
- Keywords has-patch added; needs-patch removed
comment:15
nacin — 3 years ago
- Milestone changed from 3.0 to Future Release
comment:16
voyagerfan5761 — 3 years ago
- Cc WordPress@… added
comment:17
mikeschinkel — 3 years ago
- Cc mikeschinkel@… added
comment:18
in reply to:
↑ 12
ramiy — 2 years ago
Replying to azaozz:
Most of the "add/edit post" screen is already customizable (with the metaboxes), the three items remaining are the editor, title and JS permalink.
Replying to nacin:
make it a meta box (+1).
Replying to johnl1479:
I like the idea of having each of those elements in a meta box like the rest of the elements on the screen (as in they can moved around as the user desires)
if all the elements will use meta boxes, we won't need the "Subtitle" (like suggested in http://digwp.com/2009/10/ideas-for-plugins/) we can move the excerpt meta boxes above the editor and it will use as subtitle.
comment:19
ramiy — 2 years ago
- Cc ramiy added

2.9 is now a release candidate, so enhancements belong in a future release.