WordPress.org

Make WordPress Core

Changeset 15990


Ignore:
Timestamp:
10/27/2010 12:33:29 AM (9 years ago)
Author:
nacin
Message:

More pedantry.

Location:
trunk/wp-includes
Files:
2 edited

Legend:

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

    r15689 r15990  
    178178 * Registers a new image size
    179179 */
    180 function add_image_size( $name, $width = 0, $height = 0, $crop = FALSE ) {
     180function add_image_size( $name, $width = 0, $height = 0, $crop = false ) {
    181181    global $_wp_additional_image_sizes;
    182     $_wp_additional_image_sizes[$name] = array( 'width' => absint( $width ), 'height' => absint( $height ), 'crop' => !!$crop );
     182    $_wp_additional_image_sizes[$name] = array( 'width' => absint( $width ), 'height' => absint( $height ), 'crop' => (bool) $crop );
    183183}
    184184
     
    186186 * Registers an image size for the post thumbnail
    187187 */
    188 function set_post_thumbnail_size( $width = 0, $height = 0, $crop = FALSE ) {
     188function set_post_thumbnail_size( $width = 0, $height = 0, $crop = false ) {
    189189    add_image_size( 'post-thumbnail', $width, $height, $crop );
    190190}
  • trunk/wp-includes/post-thumbnail-template.php

    r15549 r15990  
    1818 * @return bool Whether post has an image attached.
    1919 */
    20 function has_post_thumbnail( $post_id = NULL ) {
    21     $post_id = ( NULL === $post_id ) ? get_the_ID() : $post_id;
    22     return !! get_post_thumbnail_id( $post_id );
     20function has_post_thumbnail( $post_id = null ) {
     21    $post_id = ( null === $post_id ) ? get_the_ID() : $post_id;
     22    return (bool) get_post_thumbnail_id( $post_id );
    2323}
    2424
     
    3131 * @return int
    3232 */
    33 function get_post_thumbnail_id( $post_id = NULL ) {
    34     $post_id = ( NULL === $post_id ) ? get_the_ID() : $post_id;
     33function get_post_thumbnail_id( $post_id = null ) {
     34    $post_id = ( null === $post_id ) ? get_the_ID() : $post_id;
    3535    return get_post_meta( $post_id, '_thumbnail_id', true );
    3636}
     
    4545 */
    4646function the_post_thumbnail( $size = 'post-thumbnail', $attr = '' ) {
    47     echo get_the_post_thumbnail( NULL, $size, $attr );
     47    echo get_the_post_thumbnail( null, $size, $attr );
    4848}
    4949
     
    5757 * @param string|array $attr Optional. Query string or array of attributes.
    5858 */
    59 function get_the_post_thumbnail( $post_id = NULL, $size = 'post-thumbnail', $attr = '' ) {
    60     $post_id = ( NULL === $post_id ) ? get_the_ID() : $post_id;
     59function get_the_post_thumbnail( $post_id = null, $size = 'post-thumbnail', $attr = '' ) {
     60    $post_id = ( null === $post_id ) ? get_the_ID() : $post_id;
    6161    $post_thumbnail_id = get_post_thumbnail_id( $post_id );
    6262    $size = apply_filters( 'post_thumbnail_size', $size );
Note: See TracChangeset for help on using the changeset viewer.