REST API: Fix PHP warning about undefined `paged` argument in various REST API endpoints.
This bug could occur in `WP_REST_Posts_Controller`, `WP_REST_Global_Styles_Revisions_Controller`, `WP_REST_Revisions_Controller`, and any of their child classes. This changeset fixes it throughout. Props apermo, pbearne, hemant-ahir, flixos90. Fixes #62292. Built from https://develop.svn.wordpress.org/trunk@59630 git-svn-id: http://core.svn.wordpress.org/trunk@58993 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
8e649f1a2e
commit
b742570d1b
|
@ -189,7 +189,7 @@ class WP_REST_Global_Styles_Revisions_Controller extends WP_REST_Revisions_Contr
|
|||
$revisions_query = new WP_Query();
|
||||
$revisions = $revisions_query->query( $query_args );
|
||||
$offset = isset( $query_args['offset'] ) ? (int) $query_args['offset'] : 0;
|
||||
$page = (int) $query_args['paged'];
|
||||
$page = isset( $query_args['paged'] ) ? (int) $query_args['paged'] : 0;
|
||||
$total_revisions = $revisions_query->found_posts;
|
||||
|
||||
if ( $total_revisions < 1 ) {
|
||||
|
|
|
@ -457,7 +457,7 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
|
|||
remove_filter( 'post_password_required', array( $this, 'check_password_required' ) );
|
||||
}
|
||||
|
||||
$page = (int) $query_args['paged'];
|
||||
$page = isset( $query_args['paged'] ) ? (int) $query_args['paged'] : 0;
|
||||
$total_posts = $posts_query->found_posts;
|
||||
|
||||
if ( $total_posts < 1 && $page > 1 ) {
|
||||
|
|
|
@ -294,7 +294,7 @@ class WP_REST_Revisions_Controller extends WP_REST_Controller {
|
|||
$revisions_query = new WP_Query();
|
||||
$revisions = $revisions_query->query( $query_args );
|
||||
$offset = isset( $query_args['offset'] ) ? (int) $query_args['offset'] : 0;
|
||||
$page = (int) $query_args['paged'];
|
||||
$page = isset( $query_args['paged'] ) ? (int) $query_args['paged'] : 0;
|
||||
$total_revisions = $revisions_query->found_posts;
|
||||
|
||||
if ( $total_revisions < 1 ) {
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '6.8-alpha-59607';
|
||||
$wp_version = '6.8-alpha-59630';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue