Change hook 'post_edit_form_tag' from an action to a filter
|Reported by:||mikeschinkel||Owned by:|
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.