IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
277 | 277 | return false; |
278 | 278 | } |
279 | 279 | |
| 280 | |
| 281 | /** |
| 282 | * Gets the width, height, and cropping behaviour of the named image size specified by $size. |
| 283 | * |
| 284 | * @see add_image_size() for details on cropping behaviour. |
| 285 | * |
| 286 | * @global array $_wp_additional_image_sizes Associative array of additional image sizes. |
| 287 | * |
| 288 | * @param string $size_name A named image size, either built-in or added to WordPress using add_image_size() |
| 289 | * |
| 290 | * @return array|bool Associative array with 'width', 'height', and (boolean) crop. These correspond to arguments |
| 291 | * for add_image_size(); |
| 292 | */ |
| 293 | function get_image_size( $size_name = '' ) { |
| 294 | |
| 295 | $size = false; |
| 296 | |
| 297 | if ( in_array( $size_name, array( 'thumbnail', 'medium', 'large' ) ) ) { |
| 298 | |
| 299 | $size = array( |
| 300 | 'width' => get_option( $size_name . '_size_w' ), |
| 301 | 'height' => get_option( $size_name . '_size_h' ), |
| 302 | 'crop' => get_option( $size_name . '_crop' ) |
| 303 | ); |
| 304 | |
| 305 | } elseif ( has_image_size( $size_name ) ) { |
| 306 | |
| 307 | global $_wp_additional_image_sizes; |
| 308 | $size = $_wp_additional_image_sizes[ $size_name ]; |
| 309 | |
| 310 | } |
| 311 | |
| 312 | return $size; |
| 313 | } |
| 314 | |
| 315 | |
280 | 316 | /** |
281 | 317 | * Registers an image size for the post thumbnail. |
282 | 318 | * |