-
-
Save mvriel/6441817 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Override default image downsize rules with a custom resizing service | |
* | |
* Defaults to false (no third-party downsizing), but can be overriden with an indexed | |
* array of image details to use in place of WP's default downsizing rules. | |
* | |
* @since 2.5.0 | |
* | |
* @param false|array $image_downsize { | |
* Indexed array of details on success. | |
* | |
* @type string $img_url The URL of the downsized image | |
* @type integer $width The width of the downsized image | |
* @type integer $height The height of the downsized image | |
* @type bool $is_intermediate True if $img_url is a downsized image, false if it is the original | |
* } | |
* @param integer $id Attachment ID for image | |
* @param array|string $size Size of image, either array (e.g. array( 120, 120 )) or string (e.g. 'medium') | |
*/ | |
if ( $out = apply_filters( 'image_downsize', false, $id, $size ) ) | |
return $out; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment