[wp-trac] [WordPress Trac] #22559: Solve for incorrect uses of media_buttons_context
WordPress Trac
noreply at wordpress.org
Fri Nov 23 23:07:48 UTC 2012
#22559: Solve for incorrect uses of media_buttons_context
--------------------------+--------------------
Reporter: nacin | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 3.5
Component: Media | Version: trunk
Severity: major | Resolution:
Keywords: |
--------------------------+--------------------
Comment (by nacin):
As said by batmoo in #22186:
> ... being used incorrectly as you note (specially, using it to add media
button instead of the media_buttons action). I don't think we need to
support compatibility for the incorrect usages unless there's a compelling
reason that people are using the context filter over the action (which I
don't have).
----
Since 3.3, we've been wrapping the text from media_buttons_context with a
link, rather including it inside %s. Anyone using this filter since then
would needed to have closed an <a> tag then open a new one, all to avoid
using the right hook. You'd get:
* `<a href="...">Upload/Insert <a href="">Upload Other Media</a></a>`
Here's some research:
* ~125 plugins reference the filter in some way. I haven't looked through
yet to figure out how many of them are using it wrong, versus simply
renaming the string.
* We admitted the 3.3 breakage in ticket:18813#comment:4.
* No one has ever reported another issue with this filter:
http://core.trac.wordpress.org/search?q=media_buttons_context
Seems like we should entirely drop the filter. That said, we can actually
make it work again (as it did pre-3.3) with something like this: `echo
apply_filters( 'media_buttons_context', '' );` The only issue would be if
a plugin was actually trying to close then open an <a> tag inside the
filter, to avoid the crazy nesting. But, man, that's even worse.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/22559#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list