Make WordPress Core


Ignore:
Timestamp:
11/22/2012 09:52:16 AM (11 years ago)
Author:
nacin
Message:

WP_Image_Editor: the last stand.

  • Have wp_get_image_editor() rather than WP_Image_Editor::get_instance(). Having static factory methods would be less confusing if there weren't also static methods tied to individual editor implementations.
  • Lazy-load the WP_Image_Editor base class and editor implementations.
  • Have WP_Image_Editor_GD::supports_mime_type() actually check which types it supports.
  • Deprecate gd_edit_image_support() in favor of wp_image_editor_supports().

props DH-Shredder, scribu, markoheijnen. fixes #22356. see #6821.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/image.php

    r22571 r22817  
    3737    }
    3838
    39     $editor = WP_Image_Editor::get_instance( $src );
     39    $editor = wp_get_image_editor( $src );
    4040    if ( is_wp_error( $editor ) )
    4141        return $editor;
     
    101101
    102102        if ( $sizes ) {
    103             $editor = WP_Image_Editor::get_instance( $file );
     103            $editor = wp_get_image_editor( $file );
    104104
    105105            if ( ! is_wp_error( $editor ) )
Note: See TracChangeset for help on using the changeset viewer.