Changeset 54097 for trunk/src/wp-includes/class-wp-image-editor-gd.php
- Timestamp:
- 09/07/2022 09:43:28 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-image-editor-gd.php
r53547 r54097 228 228 * 229 229 * @param array $sizes { 230 * A n array of image size data arrays.230 * Associative array of image size names and their data. 231 231 * 232 232 * Either a height or width must be provided. … … 248 248 249 249 foreach ( $sizes as $size => $size_data ) { 250 // Include size name in the data. 251 $size_data['name'] = $size; 252 250 253 $meta = $this->make_subsize( $size_data ); 251 254 … … 262 265 * 263 266 * @since 5.3.0 267 * @since 6.1.0 The $sizes parameter may now include a $name key for each entry. 264 268 * 265 269 * @param array $size_data { 266 270 * Array of size data. 267 271 * 268 * @type int $width The maximum width in pixels. 269 * @type int $height The maximum height in pixels. 270 * @type bool $crop Whether to crop the image to exact dimensions. 272 * @type int $width The maximum width in pixels. 273 * @type int $height The maximum height in pixels. 274 * @type bool $crop Whether to crop the image to exact dimensions. 275 * @type string $name Image size name. 271 276 * } 272 277 * @return array|WP_Error The image data array for inclusion in the `sizes` array in the image meta, … … 278 283 } 279 284 280 $orig_size = $this->size; 285 $orig_size = $this->size; 286 $orig_size_name = $this->size_name; 281 287 282 288 if ( ! isset( $size_data['width'] ) ) { … … 290 296 if ( ! isset( $size_data['crop'] ) ) { 291 297 $size_data['crop'] = false; 298 } 299 300 if ( isset( $size_data['name'] ) ) { 301 $this->update_size_name( $size_data['name'] ); 292 302 } 293 303 … … 302 312 303 313 $this->size = $orig_size; 314 $this->size_name = $orig_size_name; 304 315 305 316 if ( ! is_wp_error( $saved ) ) {
Note: See TracChangeset
for help on using the changeset viewer.