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.2

apply_filters('image_downsize') is found 2 times:

  • /wp-includes/media.php line 207
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    * @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 4581
    4577
    4578
    4579
    4580
    4581
    4582
    4583
    4584
    4585
    4586
    */
    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: