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/media.php

    r22807 r22817  
    11231123
    11241124    $image_edit_button = '';
    1125     if ( gd_edit_image_support( $post->post_mime_type ) ) {
     1125    if ( wp_image_editor_supports( array( 'mime_type' => $post->post_mime_type ) ) ) {
    11261126        $nonce = wp_create_nonce( "image_editor-$post->ID" );
    11271127        $image_edit_button = "<input type='button' id='imgedit-open-btn-$post->ID' onclick='imageEdit.open( $post->ID, \"$nonce\" )' class='button' value='" . esc_attr__( 'Edit Image' ) . "' /> <span class='spinner'></span>";
     
    22542254
    22552255    $image_edit_button = '';
    2256     if ( gd_edit_image_support( $post->post_mime_type ) ) {
     2256    if ( wp_image_editor_supports( array( 'mime_type' => $post->post_mime_type ) ) ) {
    22572257        $nonce = wp_create_nonce( "image_editor-$post->ID" );
    22582258        $image_edit_button = "<input type='button' id='imgedit-open-btn-$post->ID' onclick='imageEdit.open( $post->ID, \"$nonce\" )' class='button' value='" . esc_attr__( 'Edit Image' ) . "' /> <span class='spinner'></span>";
Note: See TracChangeset for help on using the changeset viewer.