From 1578e09168147e40a0acad3656d94c5753eb31e9 Mon Sep 17 00:00:00 2001 From: Huzaifa Al Mesbah Date: Mon, 23 Feb 2026 23:37:58 +0600 Subject: [PATCH] Fix PHPStan return.empty errors in core methods --- src/wp-includes/class-wp-query.php | 6 +++--- src/wp-includes/theme.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/wp-includes/class-wp-query.php b/src/wp-includes/class-wp-query.php index 2e18b7eb977e5..1eeeba6d19afd 100644 --- a/src/wp-includes/class-wp-query.php +++ b/src/wp-includes/class-wp-query.php @@ -4816,7 +4816,7 @@ public function is_main_query() { * @global int $numpages * * @param WP_Post|object|int $post WP_Post instance or Post ID/object. - * @return true True when finished. + * @return bool True on success, false on failure. */ public function setup_postdata( $post ) { global $id, $authordata, $currentday, $currentmonth, $page, $pages, $multipage, $more, $numpages; @@ -4826,12 +4826,12 @@ public function setup_postdata( $post ) { } if ( ! $post ) { - return; + return false; } $elements = $this->generate_postdata( $post ); if ( false === $elements ) { - return; + return false; } $id = $elements['id']; diff --git a/src/wp-includes/theme.php b/src/wp-includes/theme.php index 44343569a61b1..db93c577d87cb 100644 --- a/src/wp-includes/theme.php +++ b/src/wp-includes/theme.php @@ -3095,7 +3095,7 @@ function _remove_theme_support( $feature ) { return false; } add_theme_support( 'custom-header', array( 'uploads' => false ) ); - return; // Do not continue - custom-header-uploads no longer exists. + return true; // Do not continue - custom-header-uploads no longer exists. } if ( ! isset( $_wp_theme_features[ $feature ] ) ) {