Make WordPress Core


Ignore:
Timestamp:
09/06/2022 09:13:17 PM (2 years ago)
Author:
adamsilverstein
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/rest-api/rest-attachments-controller.php

    r54085 r54086  
    9494        add_filter( 'rest_pre_dispatch', array( $this, 'wpSetUpBeforeRequest' ), 10, 3 );
    9595        add_filter( 'posts_clauses', array( $this, 'save_posts_clauses' ), 10, 2 );
     96        add_filter( 'image_editor_output_format', '__return_empty_array' );
    9697    }
    9798
     
    121122            WP_Image_Editor_Mock::$size_return = null;
    122123        }
     124
     125        remove_filter( 'image_editor_output_format', '__return_empty_array' );
    123126
    124127        parent::tear_down();
Note: See TracChangeset for help on using the changeset viewer.