jetpack_images_fit_image_url_override

Filters the image URL used after dimensions are set by Photon.

Description

apply_filters( 'jetpack_images_fit_image_url_override', (string) $src, (int) $width, (int) $height ); 

Parameters (3)

0. $src (string)
Image URL.
1. $width (int)
Image width.
2. $height (int)
Image height.

Usage

To run the hook, copy the example below.
  1. $src = apply_filters( 'jetpack_images_fit_image_url_override', $src, $width, $height ); 
  2.  
  3. if ( !empty( $src ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the jetpack_images_fit_image_url_override callback 
  2. function filter_jetpack_images_fit_image_url_override( $src, $width, $height ) { 
  3. // make filter magic happen here... 
  4. return $src
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'jetpack_images_fit_image_url_override', 'filter_jetpack_images_fit_image_url_override', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'jetpack_images_fit_image_url_override', 'filter_jetpack_images_fit_image_url_override', 10, 3 ); 

Defined (1)

The filter is defined in the following location(s).

/class.jetpack-post-images.php  
  1. return apply_filters( 'jetpack_images_fit_image_url_override', $src, $width, $height );