Make WordPress Core


Ignore:
Timestamp:
11/22/2012 09:52:16 AM (12 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-edit.php

    r22807 r22817  
    458458    @ini_set( 'memory_limit', apply_filters( 'admin_memory_limit', WP_MAX_MEMORY_LIMIT ) );
    459459
    460     $img = WP_Image_Editor::get_instance( _load_image_to_edit_path( $post_id ) );
     460    $img = wp_get_image_editor( _load_image_to_edit_path( $post_id ) );
    461461
    462462    if ( is_wp_error( $img ) )
     
    567567    $post = get_post( $post_id );
    568568
    569     $img = WP_Image_Editor::get_instance( _load_image_to_edit_path( $post_id, 'full' ) );
     569    $img = wp_get_image_editor( _load_image_to_edit_path( $post_id, 'full' ) );
    570570    if ( is_wp_error( $img ) ) {
    571571        $return->error = esc_js( __('Unable to create new image.') );
Note: See TracChangeset for help on using the changeset viewer.