Skip to content

Instantly share code, notes, and snippets.

@brichards

brichards/media.php

Last active Dec 21, 2015
Embed
What would you like to do?
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
You can’t perform that action at this time.