mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Media: Output WebP by default when uploading JPEGs.
Uploaded JPEGs will automatically be converted to WebP sub-sizes instead of JPEG, saving space and making sites faster. The original JPEG upload is always retained and can be accessed by calling `wp_get_original_image_url`. Props azaozz, flixos90. Fixes #55443. git-svn-id: https://develop.svn.wordpress.org/trunk@54086 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -93,6 +93,7 @@ class WP_Test_REST_Attachments_Controller extends WP_Test_REST_Post_Type_Control
|
||||
|
||||
add_filter( 'rest_pre_dispatch', array( $this, 'wpSetUpBeforeRequest' ), 10, 3 );
|
||||
add_filter( 'posts_clauses', array( $this, 'save_posts_clauses' ), 10, 2 );
|
||||
add_filter( 'image_editor_output_format', '__return_empty_array' );
|
||||
}
|
||||
|
||||
public function wpSetUpBeforeRequest( $result ) {
|
||||
@@ -121,6 +122,8 @@ class WP_Test_REST_Attachments_Controller extends WP_Test_REST_Post_Type_Control
|
||||
WP_Image_Editor_Mock::$size_return = null;
|
||||
}
|
||||
|
||||
remove_filter( 'image_editor_output_format', '__return_empty_array' );
|
||||
|
||||
parent::tear_down();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user