diff -r 7b1b88e27a20 -r 48c4eec2b7e6 wp/wp-admin/edit-form-blocks.php --- a/wp/wp-admin/edit-form-blocks.php Thu Sep 29 08:06:27 2022 +0200 +++ b/wp/wp-admin/edit-form-blocks.php Fri Sep 05 18:40:08 2025 +0200 @@ -14,11 +14,11 @@ } /** - * @global string $post_type - * @global WP_Post_Type $post_type_object + * @global string $post_type Global post type. + * @global WP_Post_Type $post_type_object Global post type object. * @global WP_Post $post Global post object. - * @global string $title - * @global array $wp_meta_boxes + * @global string $title The title of the current screen. + * @global array $wp_meta_boxes Global meta box state. */ global $post_type, $post_type_object, $post, $title, $wp_meta_boxes; @@ -31,7 +31,7 @@ // Default to is-fullscreen-mode to avoid jumps in the UI. add_filter( 'admin_body_class', - static function( $classes ) { + static function ( $classes ) { return "$classes is-fullscreen-mode"; } ); @@ -68,8 +68,13 @@ array( rest_get_route_for_post_type_items( 'attachment' ), 'OPTIONS' ), array( rest_get_route_for_post_type_items( 'page' ), 'OPTIONS' ), array( rest_get_route_for_post_type_items( 'wp_block' ), 'OPTIONS' ), + array( rest_get_route_for_post_type_items( 'wp_template' ), 'OPTIONS' ), sprintf( '%s/autosaves?context=edit', $rest_path ), '/wp/v2/settings', + array( '/wp/v2/settings', 'OPTIONS' ), + '/wp/v2/global-styles/themes/' . get_stylesheet(), + '/wp/v2/themes?context=edit&status=active', + '/wp/v2/global-styles/' . WP_Theme_JSON_Resolver::get_user_global_styles_post_id() . '?context=edit', ); block_editor_rest_api_preload( $preload_paths, $block_editor_context ); @@ -201,7 +206,7 @@ 'unlockNonce' => wp_create_nonce( 'update-post_' . $post->ID ), 'ajaxUrl' => admin_url( 'admin-ajax.php' ), ), - 'supportsLayout' => WP_Theme_JSON_Resolver::theme_has_support(), + 'supportsLayout' => wp_theme_has_theme_json(), 'supportsTemplateMode' => current_theme_supports( 'block-templates' ), // Whether or not to load the 'postcustom' meta box is stored as a user meta @@ -269,7 +274,7 @@ */ do_action( 'enqueue_block_editor_assets' ); -// In order to duplicate classic meta box behaviour, we need to run the classic meta box actions. +// In order to duplicate classic meta box behavior, we need to run the classic meta box actions. require_once ABSPATH . 'wp-admin/includes/meta-boxes.php'; register_and_do_post_meta_boxes( $post ); @@ -317,27 +322,45 @@