wppaste
WordPress

apply_filters( 'image_resize_dimensions', null|mixed $null, int $orig_w, int $orig_h, int $dest_w, int $dest_h, bool|array $crop )

Since
3.4.0
Filters whether to preempt calculating the image resize dimensions.

Description

Returning a non-null value from the filter will effectively short-circuit image_resize_dimensions(), returning that value instead.

Compatibility

WordPress
since 3.4.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Parameters

$nullnull|mixed
Whether to preempt output of the resize dimensions.
$orig_wint
Original width in pixels.
$orig_hint
Original height in pixels.
$dest_wint
New width in pixels.
$dest_hint
New height in pixels.
$cropbool|array
Whether to crop image to specified width and height or resize.
An array can specify positioning of the crop area. Default false.

Where this hook fires · 1

  • wp-includes/media.php:569image_resize_dimensions()

Source code

	 * @param int        $orig_h Original height in pixels.	 * @param int        $dest_w New width in pixels.	 * @param int        $dest_h New height in pixels.	 * @param bool|array $crop   Whether to crop image to specified width and height or resize.	 *                           An array can specify positioning of the crop area. Default false.	 */	$output = apply_filters( 'image_resize_dimensions', null, $orig_w, $orig_h, $dest_w, $dest_h, $crop ); 	if ( null !== $output ) {		return $output;	} 	// Stop if the destination size is larger than the original image dimensions.

Changelog

Introduced in 3.4.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 6.8.8 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.