From 5ffa346fd0a4dc5e1c0add9099f4a461aff57a19 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 22 May 2021 13:00:02 +0000 Subject: [PATCH] Media: Some documentation and test improvements for the `image_editor_output_format` filter: * Update the filter DocBlock per the documentation standards. * Use a shorter variable name for consistency with the surrounding code. * Delete the test file before performing assertions to avoid leftovers in case the test fails. Follow-up to [50943]. See #52867. Built from https://develop.svn.wordpress.org/trunk@50951 git-svn-id: http://core.svn.wordpress.org/trunk@50560 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-image-editor.php | 19 +++++++++---------- wp-includes/version.php | 2 +- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/wp-includes/class-wp-image-editor.php b/wp-includes/class-wp-image-editor.php index d322d6a7cb..37b65ca8d1 100644 --- a/wp-includes/class-wp-image-editor.php +++ b/wp-includes/class-wp-image-editor.php @@ -322,29 +322,28 @@ abstract class WP_Image_Editor { * Enables filtering the mime type used to save images. By default, * the mapping array is empty, so the mime type matches the source image. * - * @see src/wp-includes/class-wp-image-editor.php -> get_output_format() + * @see WP_Image_Editor::get_output_format() * * @since 5.8.0 * - * @param array $wp_image_editor_output_format { + * @param array $output_format { * An array of mime type mappings. Maps a source mime type to a new - * destination mime type. Empty by default. + * destination mime type. Default empty array. * * @type array $mime_type The source mime type { * @type string $mime_type The new mime type. * } - * @param string $filename Path to the image. + * @param string $filename Path to the image. * @param string $mime_type The source image mime type. * } */ - $wp_image_editor_output_format = apply_filters( 'image_editor_output_format', array(), $filename, $mime_type ); + $output_format = apply_filters( 'image_editor_output_format', array(), $filename, $mime_type ); - if ( - isset( $wp_image_editor_output_format[ $mime_type ] ) && - $this->supports_mime_type( $wp_image_editor_output_format[ $mime_type ] ) + if ( isset( $output_format[ $mime_type ] ) + && $this->supports_mime_type( $output_format[ $mime_type ] ) ) { - $mime_type = $wp_image_editor_output_format[ $mime_type ]; - $new_ext = $this->get_extension( $mime_type ); + $mime_type = $output_format[ $mime_type ]; + $new_ext = $this->get_extension( $mime_type ); } // Double-check that the mime-type selected is supported by the editor. diff --git a/wp-includes/version.php b/wp-includes/version.php index c5c14922b8..5da20218b6 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.8-alpha-50950'; +$wp_version = '5.8-alpha-50951'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.