From 3b103d83faf1cf2939085020183a58add6353b74 Mon Sep 17 00:00:00 2001 From: Jonny Harris Date: Tue, 13 Feb 2024 14:53:03 +0000 Subject: [PATCH 1/2] Set default wp_global_styles --- .../class-wp-rest-global-styles-revisions-controller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-revisions-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-revisions-controller.php index 849f5be5cd2d6..9be34e83fb0af 100644 --- a/src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-revisions-controller.php +++ b/src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-revisions-controller.php @@ -39,7 +39,7 @@ class WP_REST_Global_Styles_Revisions_Controller extends WP_REST_Revisions_Contr * * @param string $parent_post_type Post type of the parent. */ - public function __construct( $parent_post_type ) { + public function __construct( $parent_post_type = 'wp_global_styles' ) { parent::__construct( $parent_post_type ); $post_type_object = get_post_type_object( $parent_post_type ); $parent_controller = $post_type_object->get_rest_controller(); From b09dfe2a90708b1bdfbf0edea435d3685033ab8c Mon Sep 17 00:00:00 2001 From: Jonny Harris Date: Tue, 13 Feb 2024 15:16:59 +0000 Subject: [PATCH 2/2] Another fix --- .../class-wp-rest-global-styles-revisions-controller.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-revisions-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-revisions-controller.php index 9be34e83fb0af..78c933d6fdc29 100644 --- a/src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-revisions-controller.php +++ b/src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-revisions-controller.php @@ -31,6 +31,14 @@ class WP_REST_Global_Styles_Revisions_Controller extends WP_REST_Revisions_Contr */ protected $parent_base; + /** + * Parent post type. + * + * @since 6.5.0 + * @var string + */ + protected $parent_post_type; + /** * Constructor. *