Skip to content

Commit 75decb7

Browse files
Code Quality: Correct return statement in WP_Query::setup_postdata().
This reflects that the method can return both `true` (success) and `false` (failure). Follow-up to [32620], [34089], [44941]. Props huzaifaalmesbah, westonruter. See #64238. git-svn-id: https://develop.svn.wordpress.org/trunk@61727 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 6cd1f7d commit 75decb7

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/wp-includes/class-wp-query.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4816,7 +4816,7 @@ public function is_main_query() {
48164816
* @global int $numpages
48174817
*
48184818
* @param WP_Post|object|int $post WP_Post instance or Post ID/object.
4819-
* @return true True when finished.
4819+
* @return bool True on success, false on failure.
48204820
*/
48214821
public function setup_postdata( $post ) {
48224822
global $id, $authordata, $currentday, $currentmonth, $page, $pages, $multipage, $more, $numpages;
@@ -4826,12 +4826,12 @@ public function setup_postdata( $post ) {
48264826
}
48274827

48284828
if ( ! $post ) {
4829-
return;
4829+
return false;
48304830
}
48314831

48324832
$elements = $this->generate_postdata( $post );
48334833
if ( false === $elements ) {
4834-
return;
4834+
return false;
48354835
}
48364836

48374837
$id = $elements['id'];

0 commit comments

Comments
 (0)