WordPress.org

Make WordPress Core

Ticket #22538: 22538.diff

File 22538.diff, 634 bytes (added by scribu, 6 years ago)

'wp_image_editor_instance'

  • wp-includes/media.php

    diff --git wp-includes/media.php wp-includes/media.php
    index 131873a..cb2840c 100644
    function wp_get_image_editor( $path, $args = array() ) { 
    11611161                        $args['mime_type'] = $file_info['type'];
    11621162        }
    11631163
    1164         $implementation = apply_filters( 'wp_image_editor_class', _wp_image_editor_choose( $args ) );
     1164        $implementation = _wp_image_editor_choose( $args );
    11651165
    11661166        if ( $implementation ) {
    11671167                $editor = new $implementation( $path );
     1168
     1169                $editor = apply_filters( 'wp_image_editor_instance', $editor, $args );
     1170
    11681171                $loaded = $editor->load();
    11691172
    11701173                if ( is_wp_error( $loaded ) )