I18N: Move code out of translatable string in a _deprecated_argument() message in wp_stream_image(), wp_save_image_file(), and image_edit_apply_changes().

Props ramiy.
Fixes #47406.

git-svn-id: https://develop.svn.wordpress.org/trunk@45615 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2019-07-09 20:56:37 +00:00
parent 89919f6ac4
commit 9ed8e4189a

View File

@ -272,7 +272,8 @@ function wp_stream_image( $image, $mime_type, $attachment_id ) {
return true; return true;
} else { } else {
_deprecated_argument( __FUNCTION__, '3.5.0', __( '$image needs to be an WP_Image_Editor object' ) ); /* translators: 1: $image, 2: WP_Image_Editor */
_deprecated_argument( __FUNCTION__, '3.5.0', sprintf( __( '%1$s needs to be a %2$s object.' ), '$image', 'WP_Image_Editor' ) );
/** /**
* Filters the GD image resource to be streamed to the browser. * Filters the GD image resource to be streamed to the browser.
@ -340,7 +341,8 @@ function wp_save_image_file( $filename, $image, $mime_type, $post_id ) {
return $image->save( $filename, $mime_type ); return $image->save( $filename, $mime_type );
} else { } else {
_deprecated_argument( __FUNCTION__, '3.5.0', __( '$image needs to be an WP_Image_Editor object' ) ); /* translators: 1: $image, 2: WP_Image_Editor */
_deprecated_argument( __FUNCTION__, '3.5.0', sprintf( __( '%1$s needs to be a %2$s object.' ), '$image', 'WP_Image_Editor' ) );
/** This filter is documented in wp-admin/includes/image-edit.php */ /** This filter is documented in wp-admin/includes/image-edit.php */
$image = apply_filters( 'image_save_pre', $image, $post_id ); $image = apply_filters( 'image_save_pre', $image, $post_id );
@ -486,7 +488,8 @@ function _crop_image_resource( $img, $x, $y, $w, $h ) {
*/ */
function image_edit_apply_changes( $image, $changes ) { function image_edit_apply_changes( $image, $changes ) {
if ( is_resource( $image ) ) { if ( is_resource( $image ) ) {
_deprecated_argument( __FUNCTION__, '3.5.0', __( '$image needs to be an WP_Image_Editor object' ) ); /* translators: 1: $image, 2: WP_Image_Editor */
_deprecated_argument( __FUNCTION__, '3.5.0', sprintf( __( '%1$s needs to be a %2$s object.' ), '$image', 'WP_Image_Editor' ) );
} }
if ( ! is_array( $changes ) ) { if ( ! is_array( $changes ) ) {