Make WordPress Core


Ignore:
Timestamp:
02/02/2020 03:06:31 AM (5 years ago)
Author:
SergeyBiryukov
Message:

Post Thumbnails: Make sure get_post_thumbnail_id() returns an integer, to match the documented return value.

This makes the function more consistent with get_the_ID() or wp_get_post_parent_id(), both returning an integer.

Props 0v3rth3d4wn.
Fixes #40096.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/customize/manager.php

    r47122 r47160  
    712712        $this->assertEquals( '', get_page_template_slug( $posts_by_name['blog'] ) );
    713713        $this->assertEquals( $posts_by_name['waffles'], get_post_thumbnail_id( $posts_by_name['custom'] ) );
    714         $this->assertEquals( '', get_post_thumbnail_id( $posts_by_name['blog'] ) );
     714        $this->assertEquals( 0, get_post_thumbnail_id( $posts_by_name['blog'] ) );
    715715        $attachment_metadata = wp_get_attachment_metadata( $posts_by_name['waffles'] );
    716716        $this->assertEquals( 'Waffles', get_post( $posts_by_name['waffles'] )->post_title );
Note: See TracChangeset for help on using the changeset viewer.