diff --git a/gruntfile.js b/gruntfile.js index 480b9b0cd..9114273cb 100644 --- a/gruntfile.js +++ b/gruntfile.js @@ -121,6 +121,7 @@ module.exports = function ( grunt ) { '!vendor/**/*', '!package/**/*', '!php/media/class-filter.php', + '!php/misc/class-image-sizes-no-textdomain.php', ], }, }, diff --git a/php/class-utils.php b/php/class-utils.php index 4c6569e29..f88c307e8 100644 --- a/php/class-utils.php +++ b/php/class-utils.php @@ -7,6 +7,7 @@ namespace Cloudinary; +use Cloudinary\Misc\Image_Sizes_No_Textdomain; use Cloudinary\Settings\Setting; use Google\Web_Stories\Story_Post_Type; use WP_Post; @@ -472,7 +473,7 @@ public static function get_support_link( $args = array() ) { $plugin->version ) ), - 'tf_description' => esc_attr( __( 'Please, provide more details on your request, and if possible, attach a System Report', 'cloudinary' ) ), + 'tf_description' => esc_attr( __( 'Please, provide more details on your request, and if possible, attach a System Report', 'cloudinary' ) ), ); $args = wp_parse_args( @@ -924,15 +925,7 @@ public static function get_registered_sizes( $attachment_id = null ) { /** This filter is documented in wp-admin/includes/media.php */ $image_sizes = apply_filters( 'image_size_names_choose', - array( - // phpcs:disable WordPress.WP.I18n.MissingArgDomain - 'thumbnail' => __( 'Thumbnail' ), - 'medium' => __( 'Medium' ), - 'medium_large' => __( 'Medium Large' ), - 'large' => __( 'Large' ), - 'full' => __( 'Full Size' ), - // phpcs:enable WordPress.WP.I18n.MissingArgDomain - ) + Image_Sizes_No_Textdomain::get_image_sizes() ); $labels = wp_parse_args( $labels, $image_sizes ); diff --git a/php/misc/class-image-sizes-no-textdomain.php b/php/misc/class-image-sizes-no-textdomain.php new file mode 100644 index 000000000..9f28eee0b --- /dev/null +++ b/php/misc/class-image-sizes-no-textdomain.php @@ -0,0 +1,36 @@ + __( 'Thumbnail' ), + 'medium' => __( 'Medium' ), + 'medium_large' => __( 'Medium Large' ), + 'large' => __( 'Large' ), + 'full' => __( 'Full Size' ), + // phpcs:enable WordPress.WP.I18n.MissingArgDomain + ); + } +}