Skip to content

Instantly share code, notes, and snippets.

@mvriel
Forked from brichards/media.php
Last active December 22, 2015 07:59
Show Gist options
  • Save mvriel/6441817 to your computer and use it in GitHub Desktop.
Save mvriel/6441817 to your computer and use it in GitHub Desktop.
<?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