[wp-trac] [WordPress Trac] #18236: Change hook 'post_edit_form_tag' from an action to a filter
WordPress Trac
wp-trac at lists.automattic.com
Mon Jul 25 04:06:21 UTC 2011
#18236: Change hook 'post_edit_form_tag' from an action to a filter
--------------------------+------------------------------------
Reporter: mikeschinkel | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Upload | Version: 3.2.1
Severity: normal | Keywords: has-patch dev-feedback
--------------------------+------------------------------------
Currently the file `/wp-admin/edit-form-advanced.php` uses a hook to allow
for a plugin to add attributes to the `<form>` tag via the
`'post_edit_form_tag'` action. The primary motivation was to allow a
plugin to add `enctype="multipart/form-data"` as per ticket #10518.
Unfortunately using an action can potentially result in multiple plugins
emitting duplicated attributes which, while not harmful because of (most?)
browser resilience is sloppy, and it does not allow one plugin to override
another without reverting to sloppy fiddling with hook internals.
Changing it from an action to a filter as per the attached patch '''is
backwards compatible with existing plugins''' but will allow future
plugins to be more savvy about how they approach adding an attribute to
the `<form>` element.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/18236>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list