[wp-trac] [WordPress Trac] #22356: Deprecate gd_edit_image_support() and replace it with a better method
WordPress Trac
noreply at wordpress.org
Wed Nov 21 19:04:10 UTC 2012
#22356: Deprecate gd_edit_image_support() and replace it with a better method
--------------------------+--------------------------
Reporter: markoheijnen | Owner: DH-Shredder
Type: enhancement | Status: assigned
Priority: normal | Milestone: 3.5
Component: Media | Version: trunk
Severity: normal | Resolution:
Keywords: has-patch |
--------------------------+--------------------------
Comment (by DH-Shredder):
Replying to [comment:15 scribu]:
> `WP_Editor::get_instance()` doesn't make sense without a filename, so it
should look like this:
>
> {{{
> function get_instance( $filename, $args = array() )
> }}}
>
> There's no point whatsoever in mixing the $filename with $args, which
can be passed directly to supports().
This is fine, if it's where consensus lies.
I went the $args route all around because it was the simplest to follow,
and seemed preferred by most. Since a filename is always required, I have
no problem with that.
As far as the test() method, if we're going to rename it, I'd suggest
something that indicates what it actually does, which is:
"Is this editor compatible with the current environment." exists()
probably isn't quite what we're looking for. Going to think about a
better name.
In terms of the base class, I'm a fan of the idea, but unsure if it's a
good idea to change that at this juncture. Let's chat about this further.
rboren:
If we are going to consider a supports() that's everywhere, that'd mean
that all editors would need to add additional boilerplate code to handle
checking of their own methods existence, which seems unnecessary. That's
the reason that we didn't add method checks and mime checks to test(). It
would also still have the issue that markoheijnen mentions, with the
purpose of supports() being unclear when it's unimplemented by an editor.
nacin:
That's fine, if that's what consensus is. We're pretty close to that
signature at the moment, anyway, with $args being the equivalent of
$capabilities
--
Ticket URL: <http://core.trac.wordpress.org/ticket/22356#comment:21>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list