diff --git a/src/wp-includes/media.php b/src/wp-includes/media.php
index 1e6a4e5..8e45bf1 100644
a
|
b
|
function add_image_size( $name, $width = 0, $height = 0, $crop = false ) { |
284 | 284 | /** |
285 | 285 | * Check if an image size exists. |
286 | 286 | * |
| 287 | * By default, `has_image_size()` will return false for core image sizes. For |
| 288 | * this function to return true for core image sizes, pass a truthy value as |
| 289 | * the second parameter. |
| 290 | * |
287 | 291 | * @since 3.9.0 |
| 292 | * @since 5.0.0 Added support for including default image sizes by passing `true` to $include_default. |
288 | 293 | * |
289 | | * @param string $name The image size to check. |
| 294 | * @param string $name The image size to check. |
| 295 | * @param bool $include_default Whether to include default image sizes. |
290 | 296 | * @return bool True if the image size exists, false if not. |
291 | 297 | */ |
292 | | function has_image_size( $name ) { |
| 298 | function has_image_size( $name, $include_default = false ) { |
293 | 299 | $sizes = wp_get_additional_image_sizes(); |
| 300 | if( $include_default ) { |
| 301 | $default_sizes = array( |
| 302 | 'thumbnail' => true, |
| 303 | 'medium' => true, |
| 304 | 'medium-large' => true, |
| 305 | 'large' => true, |
| 306 | ); |
| 307 | $sizes = array_merge( $sizes, $default_sizes ); |
| 308 | } |
294 | 309 | return isset( $sizes[ $name ] ); |
295 | 310 | } |
296 | 311 | |