[wp-trac] [WordPress Trac] #22538: 'wp_image_editor_class' vs. 'wp_image_editors'
WordPress Trac
noreply at wordpress.org
Thu Nov 22 17:53:12 UTC 2012
#22538: 'wp_image_editor_class' vs. 'wp_image_editors'
--------------------------+--------------------
Reporter: scribu | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 3.5
Component: Media | Version: trunk
Severity: normal | Resolution:
Keywords: dev-feedback |
--------------------------+--------------------
Comment (by scribu):
Actually, it doesn't make sense to pass $args to either filter, since
$args should be checked by the test() method of your image editor.
The 'wp_image_editors' filter is just for registering the class as a
candidate:
{{{
function my_image_editor_init( $editors ) {
class My_Image_Editor extends WP_Image_Editor_Imagick {
static function test( $args = array() ) {
// this is where $args should be checked
return parent::test( $args );
}
}
array_unshift( $editors, 'My_Image_Editor' );
return $editors;
}
add_filter( 'wp_image_editors', 'my_image_editor_init' );
}}}
--
Ticket URL: <http://core.trac.wordpress.org/ticket/22538#comment:6>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list