Make WordPress Core

Changeset 12823


Ignore:
Timestamp:
01/25/2010 06:50:01 PM (15 years ago)
Author:
ryan
Message:

Deprecate wp_shrink_dimension(), add wp-admin/includes/deprecated.php. Props filosofo. fixes #11967

Location:
trunk
Files:
1 added
4 edited

Legend:

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

    r12633 r12823  
    5252require_once(ABSPATH . WPINC . '/registration.php');
    5353
     54/** WordPress Deprecated Administration API */
     55require_once(ABSPATH . 'wp-admin/includes/deprecated.php');
     56
    5457/** WordPress Multi-Site support API */
    5558if ( is_multisite() )
  • trunk/wp-admin/includes/image-edit.php

    r12789 r12823  
    454454        $meta['width'] = $data['width'];
    455455        $meta['height'] = $data['height'];
    456         list ( $uwidth, $uheight ) = wp_shrink_dimensions($meta['width'], $meta['height']);
     456        list ( $uwidth, $uheight ) = wp_constrain_dimensions($meta['width'], $meta['height'], 128, 96);
    457457        $meta['hwstring_small'] = "height='$uheight' width='$uwidth'";
    458458    }
     
    599599        $meta['height'] = imagesy($img);
    600600
    601         list ( $uwidth, $uheight ) = wp_shrink_dimensions($meta['width'], $meta['height']);
     601        list ( $uwidth, $uheight ) = wp_constrain_dimensions($meta['width'], $meta['height'], 128, 96);
    602602        $meta['hwstring_small'] = "height='$uheight' width='$uwidth'";
    603603
  • trunk/wp-admin/includes/image.php

    r12680 r12823  
    9595        $metadata['width'] = $imagesize[0];
    9696        $metadata['height'] = $imagesize[1];
    97         list($uwidth, $uheight) = wp_shrink_dimensions($metadata['width'], $metadata['height']);
     97        list($uwidth, $uheight) = wp_constrain_dimensions($metadata['width'], $metadata['height'], 128, 96);
    9898        $metadata['hwstring_small'] = "height='$uheight' width='$uwidth'";
    9999
     
    170170 *
    171171 * @since 2.0.0
    172  * @see wp_shrink_dimensions()
     172 * @see wp_constrain_dimensions()
    173173 *
    174174 * @param int $width Current width of the image
     
    177177 */
    178178function get_udims( $width, $height) {
    179     return wp_shrink_dimensions( $width, $height );
    180 }
    181 
    182 /**
    183  * Calculates the new dimentions for a downsampled image.
    184  *
    185  * @since 2.0.0
    186  * @see wp_constrain_dimensions()
    187  *
    188  * @param int $width Current width of the image
    189  * @param int $height Current height of the image
    190  * @param int $wmax Maximum wanted width
    191  * @param int $hmax Maximum wanted height
    192  * @return mixed Array(height,width) of shrunk dimensions.
    193  */
    194 function wp_shrink_dimensions( $width, $height, $wmax = 128, $hmax = 96 ) {
    195     return wp_constrain_dimensions( $width, $height, $wmax, $hmax );
     179    return wp_constrain_dimensions( $width, $height, 128, 96 );
    196180}
    197181
  • trunk/wp-includes/media.php

    r12733 r12823  
    234234 * Calculates the new dimentions for a downsampled image.
    235235 *
    236  * Same as {@link wp_shrink_dimensions()}, except the max parameters are
    237  * optional. If either width or height are empty, no constraint is applied on
     236 * If either width or height are empty, no constraint is applied on
    238237 * that dimension.
    239238 *
Note: See TracChangeset for help on using the changeset viewer.