image_downsize

image_downsize

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter
See hook in action

See hook in core

Displaying hooks found in version: wordpress-6.7

apply_filters('image_downsize') is found 2 times:

  • /wp-includes/media.php line 207
    	 * @param int          $id       Attachment ID for image.
    	 * @param string|int[] $size     Requested image size. Can be any registered image size name, or
    	 *                               an array of width and height values in pixels (in that order).
    	 */
    	$out = apply_filters( 'image_downsize', false, $id, $size );
    
    	if ( $out ) {
    		return $out;
    	}
    
    	$img_url          = wp_get_attachment_url( $id );
    
  • /wp-includes/media.php line 4533
    		 */
    		foreach ( $possible_sizes as $size => $label ) {
    
    			/** This filter is documented in wp-includes/media.php */
    			$downsize = apply_filters( 'image_downsize', false, $attachment->ID, $size );
    
    			if ( $downsize ) {
    				if ( empty( $downsize[3] ) ) {
    					continue;
    				}
    
    

See this hook used in plugins: