Skip to content

Instantly share code, notes, and snippets.

@brichards
Last active December 21, 2015 12:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save brichards/6308323 to your computer and use it in GitHub Desktop.
Save brichards/6308323 to your computer and use it in GitHub Desktop.
Hook documentation for the image_downsize filter
<?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