Opened 15 years ago
Closed 11 years ago
#11469 closed enhancement (fixed)
Additional Admin UI hooks / filters
Reported by: | johnl1479 | Owned by: | |
---|---|---|---|
Milestone: | 3.4.2 | Priority: | normal |
Severity: | normal | Version: | 2.9 |
Component: | Plugins | Keywords: | has-patch 2nd-opinion |
Focuses: | administration | Cc: |
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 (28)
#2
@
15 years ago
- Component changed from General to Administration
- Milestone changed from 2.9 to Future Release
#3
@
15 years ago
- Keywords has-patch added
- Milestone changed from Future Release to 3.0
- Version set to 2.9
#4
follow-up:
↓ 6
@
15 years ago
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.
#6
in reply to:
↑ 4
@
15 years ago
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.
#7
@
15 years ago
- Cc johnl1479 added
- Summary changed from Additional hooks to Additional Admin UI hooks / filters
I implemented this as a filter, per hakre's suggestion.
#9
follow-up:
↓ 10
@
15 years ago
For 11469-3.diff you should use heredoc syntax.
#10
in reply to:
↑ 9
@
15 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.
#11
@
15 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 __()
.)
#12
follow-up:
↓ 18
@
15 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
#13
@
15 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.
#18
in reply to:
↑ 12
@
14 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.
#23
in reply to:
↑ 22
;
follow-up:
↓ 24
@
11 years ago
Replying to ocean90:
We have now
edit_form_top
(#24861),edit_form_after_editor
(#19658) andedit_form_after_title
#21391.
Not sure if a filter for the title is needed.
edit_post_form_after_title or something to that order is interesting. Last I checked, you can only hook things *after* the content editor, not between the title editor and the content editor. (Or for that matter, disable either of the two or the url editor.)
#24
in reply to:
↑ 23
@
11 years ago
- Milestone changed from Future Release to 3.4.2
- Resolution set to fixed
- Status changed from new to closed
Replying to Denis-de-Bernardy:
edit_post_form_after_title or something to that order is interesting. Last I checked, you can only hook things *after* the content editor, not between the title editor and the content editor. (Or for that matter, disable either of the two or the url editor.)
I would check again. As ocean90 pointed out, edit_form_top
, edit_form_after_title
, and edit_form_after_editor
exist now. So does remove_post_type_support()
.
I think we're good here. Closing as fixed in 3.5, when we added the after title and editor ones.
2.9 is now a release candidate, so enhancements belong in a future release.