mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@22817 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -457,7 +457,7 @@ function stream_preview_image( $post_id ) {
|
||||
$post = get_post( $post_id );
|
||||
@ini_set( 'memory_limit', apply_filters( 'admin_memory_limit', WP_MAX_MEMORY_LIMIT ) );
|
||||
|
||||
$img = WP_Image_Editor::get_instance( _load_image_to_edit_path( $post_id ) );
|
||||
$img = wp_get_image_editor( _load_image_to_edit_path( $post_id ) );
|
||||
|
||||
if ( is_wp_error( $img ) )
|
||||
return false;
|
||||
@@ -566,7 +566,7 @@ function wp_save_image( $post_id ) {
|
||||
$success = $delete = $scaled = $nocrop = false;
|
||||
$post = get_post( $post_id );
|
||||
|
||||
$img = WP_Image_Editor::get_instance( _load_image_to_edit_path( $post_id, 'full' ) );
|
||||
$img = wp_get_image_editor( _load_image_to_edit_path( $post_id, 'full' ) );
|
||||
if ( is_wp_error( $img ) ) {
|
||||
$return->error = esc_js( __('Unable to create new image.') );
|
||||
return $return;
|
||||
|
||||
Reference in New Issue
Block a user