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/src/wp-includes/author-template.php

    r55755 r60299  
    287287                return 0;
    288288        }
    289         return count_user_posts( $post->post_author, $post->post_type );
     289        return (int) count_user_posts( $post->post_author, $post->post_type );
    290290}
    291291
Note: See TracChangeset for help on using the changeset viewer.