diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 07:57:30 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 07:57:30 +0000 |
commit | fa9a33d818470a5796f0ff8797f98b510ed8de18 (patch) | |
tree | bde6a1eede376f9b5df5898ce812330152984d8e /wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php | |
parent | Releasing progress-linux version 6.4.3+dfsg1-1~progress7.99u1. (diff) | |
download | wordpress-fa9a33d818470a5796f0ff8797f98b510ed8de18.tar.xz wordpress-fa9a33d818470a5796f0ff8797f98b510ed8de18.zip |
Merging upstream version 6.5+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php')
-rw-r--r-- | wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php index abfef4e..4501e47 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php @@ -403,7 +403,7 @@ class WP_REST_Posts_Controller extends WP_REST_Controller { $total_posts = $count_query->found_posts; } - $max_pages = ceil( $total_posts / (int) $posts_query->query_vars['posts_per_page'] ); + $max_pages = (int) ceil( $total_posts / (int) $posts_query->query_vars['posts_per_page'] ); if ( $page > $max_pages && $total_posts > 0 ) { return new WP_Error( @@ -1742,6 +1742,8 @@ class WP_REST_Posts_Controller extends WP_REST_Controller { * @since 4.7.0 * @since 5.9.0 Renamed `$post` to `$item` to match parent class for PHP 8 named parameter support. * + * @global WP_Post $post Global post object. + * * @param WP_Post $item Post object. * @param WP_REST_Request $request Request object. * @return WP_REST_Response Response object. @@ -2375,6 +2377,7 @@ class WP_REST_Posts_Controller extends WP_REST_Controller { 'comments', 'revisions', 'custom-fields', + 'thumbnail', ), ); |