Changeset 54097 for trunk/src/wp-includes/class-wp-image-editor.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.php
r54086 r54097 15 15 protected $file = null; 16 16 protected $size = null; 17 protected $size_name = ''; 17 18 protected $mime_type = null; 18 19 protected $output_mime_type = null; … … 118 119 * 119 120 * @param array $sizes { 120 * A n array of image size arrays. Default sizes are 'small', 'medium', 'large'.121 * Associative array of image size names and their data. Default sizes are 'small', 'medium', 'large'. 121 122 * 122 123 * @type array ...$0 { … … 186 187 * @since 3.5.0 187 188 * 188 * @return int[]{189 * @return array { 189 190 * Dimensions of the image. 190 191 * … … 202 203 * @since 3.5.0 203 204 * 204 * @param int $width 205 * @param int $height 206 * @return true 205 * @param int $width The image width. 206 * @param int $height The image height. 207 * @return true True on success, false on failure. 207 208 */ 208 209 protected function update_size( $width = null, $height = null ) { … … 212 213 ); 213 214 return true; 215 } 216 217 /** 218 * Gets the current image size name. 219 * 220 * @since 6.1.0 221 * 222 * @return string Image size name, or empty string if none set. 223 */ 224 public function get_size_name() { 225 return $this->size_name; 226 } 227 228 /** 229 * Sets the current image size name. 230 * 231 * @since 6.1.0 232 * 233 * @param string $size_name The image size name. 234 */ 235 protected function update_size_name( $size_name ) { 236 $this->size_name = (string) $size_name; 214 237 } 215 238 … … 365 388 * 366 389 * @since 5.8.0 390 * @since 6.1.0 The $size_name parameter was added. 367 391 * 368 392 * @param string[] $output_format { … … 374 398 * @param string $filename Path to the image. 375 399 * @param string $mime_type The source image mime type. 400 * @param string $size_name The image size name to create, or empty string if not set. 376 401 */ 377 $output_format = apply_filters( 'image_editor_output_format', array(), $filename, $mime_type );402 $output_format = apply_filters( 'image_editor_output_format', array(), $filename, $mime_type, $this->size_name ); 378 403 379 404 if ( isset( $output_format[ $mime_type ] )
Note: See TracChangeset
for help on using the changeset viewer.