[wp-trac] [WordPress Trac] #24202: Self-explanatory argument values for new media functions
WordPress Trac
noreply at wordpress.org
Fri May 3 16:15:43 UTC 2013
#24202: Self-explanatory argument values for new media functions
------------------------------------------------+--------------------
Reporter: SergeyBiryukov | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 3.6
Component: Media | Version: trunk
Severity: normal | Resolution:
Keywords: dev-feedback 2nd-opinion has-patch |
------------------------------------------------+--------------------
Comment (by kovshenin):
This is a little bit tricky. Content is passed around by reference in most
cases, so that the function can change it. If we're going to use an array
instead, we have to explicitly pass content to such functions by
reference:
{{{
$media = get_content_media( array(
'type' => 'video',
'content' => &$content,
) );
}}}
Otherwise the function will be changing its own copy of `$content`, and
`$remove` would be pretty useless and confusing. We should consider
leaving `$content` as a separate argument, passed by reference by default,
and an `$args` array with everything else. Thoughts?
--
Ticket URL: <http://core.trac.wordpress.org/ticket/24202#comment:7>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list