File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -785,6 +785,8 @@ function webp_uploads_init(): void {
785
785
* Automatically opt into extra image sizes when generating fallback images.
786
786
*
787
787
* @since n.e.x.t
788
+ *
789
+ * @global array $_wp_additional_image_sizes Associative array of additional image sizes.
788
790
*/
789
791
function webp_uploads_opt_in_extra_image_sizes (): void {
790
792
if ( ! webp_uploads_is_fallback_enabled () ) {
@@ -793,11 +795,7 @@ function webp_uploads_opt_in_extra_image_sizes(): void {
793
795
794
796
global $ _wp_additional_image_sizes ;
795
797
796
- if ( ! is_array ( $ _wp_additional_image_sizes ) ) {
797
- return ;
798
- }
799
-
800
- // NOTE: Modifying global to mimic the "hypothetical" WP core API behavior.
798
+ // Modify global to mimic the "hypothetical" WP core API behavior via an additional `add_image_size()` parameter.
801
799
802
800
if ( isset ( $ _wp_additional_image_sizes ['1536x1536 ' ] ) && ! isset ( $ _wp_additional_image_sizes ['1536x1536 ' ]['provide_additional_mime_types ' ] ) ) {
803
801
$ _wp_additional_image_sizes ['1536x1536 ' ]['provide_additional_mime_types ' ] = true ; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
You can’t perform that action at this time.
0 commit comments