Make WordPress Core


Ignore:
Timestamp:
06/11/2025 03:27:43 PM (16 months ago)
Author:
SergeyBiryukov
Message:

Users: Correct get_the_author_posts() to always return an integer.

This matches the documented @return type.

Follow-up to [5638], [13576], [36085], [60296].

Props justlevine.
See #63268.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/user/getTheAuthorPosts.php

    r55754 r60299  
    4343                $this->assertSame( 0, get_the_author_posts() );
    4444                $GLOBALS['post'] = self::$post_id;
    45                 $this->assertEquals( 1, get_the_author_posts() );
     45                $this->assertSame( 1, get_the_author_posts() );
    4646        }
    4747
    … …  
    6161                $GLOBALS['post'] = $cpt_ids[0];
    6262
    63                 $this->assertEquals( 2, get_the_author_posts() );
     63                $this->assertSame( 2, get_the_author_posts() );
    6464
    6565                _unregister_post_type( 'wptests_pt' );
Note: See TracChangeset for help on using the changeset viewer.