Last active
December 21, 2015 12:49
-
-
Save brichards/6308323 to your computer and use it in GitHub Desktop.
Hook documentation for the image_downsize filter
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 pass an indexed | |
* array of image details to use in place of WP's default downsizing rules | |
* and short-circuit the remainder of the function. | |
* | |
* @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