WordPress.org

Make WordPress Core

Changeset 34480


Ignore:
Timestamp:
09/24/2015 04:37:48 AM (4 years ago)
Author:
wonderboymusic
Message:

Post Thumbnails: In get_the_post_thumbnail_url(), return false instead of empty string when no URL is available.

Fixes #33070.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/post-thumbnail-template.php

    r34373 r34480  
    180180 * @param string|array $size Optional. Registered image size to retrieve the source for or a flat
    181181 *                           array of height and width dimensions. Default 'post-thumbnail'.
    182  * @return string Post thumbnail URL or empty string.
     182 * @return string|false Post thumbnail URL or false if no URL is available.
    183183 */
    184184function get_the_post_thumbnail_url( $post = null, $size = 'post-thumbnail' ) {
    185185    $image = wp_get_attachment_image_url( get_post_thumbnail_id( $post ), $size );
    186     return isset( $image ) ? $image : '';
     186    return isset( $image ) ? $image : false;
    187187}
    188188
Note: See TracChangeset for help on using the changeset viewer.