diff --git a/wp-admin/includes/admin-filters.php b/wp-admin/includes/admin-filters.php index f5f9600332..e80c111dde 100644 --- a/wp-admin/includes/admin-filters.php +++ b/wp-admin/includes/admin-filters.php @@ -37,8 +37,6 @@ add_filter( 'media_upload_library', 'media_upload_library' ); add_filter( 'media_upload_tabs', 'update_gallery_tab' ); -add_filter( 'image_editor_output_format', 'wp_default_image_output_mapping' ); - // Admin color schemes. add_action( 'admin_init', 'register_admin_color_schemes', 1 ); add_action( 'admin_head', 'wp_color_scheme_settings' ); diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php index 3e2093ac2b..51f21ddb7d 100644 --- a/wp-admin/includes/media.php +++ b/wp-admin/includes/media.php @@ -3843,18 +3843,3 @@ function wp_media_attach_action( $parent_id, $action = 'attach' ) { exit; } } - -/** - * Filters the default image output mapping. - * - * With this filter callback, WebP image files will be generated for certain JPEG source files. - * - * @since 6.1.0 - * - * @param array $output_mapping Map of mime type to output format. - * @retun array The adjusted default output mapping. - */ -function wp_default_image_output_mapping( $output_mapping ) { - $output_mapping['image/jpeg'] = 'image/webp'; - return $output_mapping; -} diff --git a/wp-includes/default-filters.php b/wp-includes/default-filters.php index 4933e3f88f..ad9cef6691 100644 --- a/wp-includes/default-filters.php +++ b/wp-includes/default-filters.php @@ -632,6 +632,8 @@ add_action( 'media_buttons', 'media_buttons' ); add_filter( 'image_send_to_editor', 'image_add_caption', 20, 8 ); add_filter( 'media_send_to_editor', 'image_media_send_to_editor', 10, 3 ); +add_filter( 'image_editor_output_format', 'wp_default_image_output_mapping' ); + // Embeds. add_action( 'rest_api_init', 'wp_oembed_register_route' ); add_filter( 'rest_pre_serve_request', '_oembed_rest_pre_serve_request', 10, 4 ); diff --git a/wp-includes/media.php b/wp-includes/media.php index e398644178..5de60501c3 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -3904,6 +3904,21 @@ function _wp_image_editor_choose( $args = array() ) { return false; } +/** + * Filters the default image output mapping. + * + * With this filter callback, WebP image files will be generated for certain JPEG source files. + * + * @since 6.1.0 + * + * @param array $output_mapping Map of mime type to output format. + * @retun array The adjusted default output mapping. + */ +function wp_default_image_output_mapping( $output_mapping ) { + $output_mapping['image/jpeg'] = 'image/webp'; + return $output_mapping; +} + /** * Prints default Plupload arguments. * diff --git a/wp-includes/version.php b/wp-includes/version.php index 9677927709..fc61753e3b 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.1-alpha-54093'; +$wp_version = '6.1-alpha-54094'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.