WordPress.org

Make WordPress Core

Changeset 20694


Ignore:
Timestamp:
05/02/12 20:15:44 (2 years ago)
Author:
nacin
Message:

Add filter to image_resize_dimensions() so plugins can perform this calculation on their own. props ebababi. fixes #15989.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/media.php

    r20679 r20694  
    328328 * 
    329329 * @since 2.5.0 
     330 * @uses apply_filters() Calls 'image_resize_dimensions' on $orig_w, $orig_h, $dest_w, $dest_h and 
     331 *      $crop to provide custom resize dimensions. 
    330332 * 
    331333 * @param int $orig_w Original width. 
     
    343345    if ($dest_w <= 0 && $dest_h <= 0) 
    344346        return false; 
     347 
     348    // plugins can use this to provide custom resize dimensions 
     349    $output = apply_filters( 'image_resize_dimensions', null, $orig_w, $orig_h, $dest_w, $dest_h, $crop ); 
     350    if ( null !== $output ) 
     351        return $output; 
    345352 
    346353    if ( $crop ) { 
Note: See TracChangeset for help on using the changeset viewer.