diff --git a/src/wp-includes/meta.php b/src/wp-includes/meta.php index 64e075017648d..f06dd2e57ccea 100644 --- a/src/wp-includes/meta.php +++ b/src/wp-includes/meta.php @@ -1182,7 +1182,8 @@ function delete_metadata_by_mid( $meta_type, $meta_id ) { * @param string $meta_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', * 'user', or any other object type with an associated meta table. * @param string|int[] $object_ids Array or comma delimited list of object IDs to update cache for. - * @return array|false Metadata cache for the specified objects, or false on failure. + * @return array>|bool Metadata cache for the specified objects, false on failure, + * or a boolean if the update was short-circuited by the filter. */ function update_meta_cache( $meta_type, $object_ids ) { global $wpdb; diff --git a/src/wp-includes/ms-site.php b/src/wp-includes/ms-site.php index 71b9823728d7a..9fdf0937b1717 100644 --- a/src/wp-includes/ms-site.php +++ b/src/wp-includes/ms-site.php @@ -419,7 +419,8 @@ function update_site_cache( $sites, $update_meta_cache = true ) { * @since 5.1.0 * * @param array $site_ids List of site IDs. - * @return array|false An array of metadata on success, false if there is nothing to update. + * @return array>|bool An array of metadata on success, false if there is nothing to update, + * or a boolean if the update was short-circuited by the filter. */ function update_sitemeta_cache( $site_ids ) { // Ensure this filter is hooked in even if the function is called early. diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php index 6d42c97836dea..5cb2d3ce72da3 100644 --- a/src/wp-includes/post.php +++ b/src/wp-includes/post.php @@ -8353,7 +8353,8 @@ function update_post_parent_caches( $posts ) { * @since 2.1.0 * * @param int[] $post_ids Array of post IDs. - * @return array|false An array of metadata on success, false if there is nothing to update. + * @return array>|bool An array of metadata on success, false if there is nothing to update, + * or a boolean if the update was short-circuited by the filter. */ function update_postmeta_cache( $post_ids ) { return update_meta_cache( 'post', $post_ids ); diff --git a/src/wp-includes/taxonomy.php b/src/wp-includes/taxonomy.php index 06d1d3581dd00..4a428ef3363d9 100644 --- a/src/wp-includes/taxonomy.php +++ b/src/wp-includes/taxonomy.php @@ -1556,7 +1556,8 @@ function update_term_meta( $term_id, $meta_key, $meta_value, $prev_value = '' ) * @since 4.4.0 * * @param array $term_ids List of term IDs. - * @return array|false An array of metadata on success, false if there is nothing to update. + * @return array>|bool An array of metadata on success, false if there is nothing to update, + * or a boolean if the update was short-circuited by the filter. */ function update_termmeta_cache( $term_ids ) { return update_meta_cache( 'term', $term_ids ); diff --git a/tests/phpstan/baselines/return.type.neon b/tests/phpstan/baselines/return.type.neon index 9143cbd2bbad7..e2bcbc565e381 100644 --- a/tests/phpstan/baselines/return.type.neon +++ b/tests/phpstan/baselines/return.type.neon @@ -68,11 +68,6 @@ parameters: identifier: return.type count: 1 path: ../../../src/wp-includes/fonts.php - - - message: '#^Function update_meta_cache\(\) should return array\|false but returns bool\.$#' - identifier: return.type - count: 1 - path: ../../../src/wp-includes/meta.php - message: '#^Function wp_post_revision_title\(\) should return string\|false but returns null\.$#' identifier: return.type