[wp-trac] [WordPress Trac] #11976: wp_iframe() style inclusion when using objects/methods
WordPress Trac
wp-trac at lists.automattic.com
Fri Jan 22 22:00:43 UTC 2010
#11976: wp_iframe() style inclusion when using objects/methods
--------------------------+-------------------------------------------------
Reporter: technosailor | Owner: technosailor
Type: defect (bug) | Status: new
Priority: normal | Milestone: 3.0
Component: Media | Version:
Severity: normal | Keywords: has-patch
--------------------------+-------------------------------------------------
Comment(by filosofo):
It would probably be better to rewrite the logic of the function, which is
a mess: Allowing an indefinite number and arrangement of arguments;
assuming the function is a string in one place but checking whether it is
in another. None of which is necessary since almost all of the media_*
functions have a similar argument structure.
And this is a good example of how having PHP 5 would help make things more
robust. You could make the media functions to be objects that implement a
media interface. Type hinting in wp_iframe would cover the necessary
check, and then you could use the sub-classed media object to enqueue
scripts, provide class names, or whatever.
/rant
--
Ticket URL: <http://core.trac.wordpress.org/ticket/11976#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list