From 89a3927fa8bdb7e7b34576f4dc094282774cf675 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Albert=20Juh=C3=A9=20Lluveras?= Date: Tue, 14 May 2024 15:27:23 +0200 Subject: [PATCH] Fix broken template revert --- .../class-gutenberg-rest-templates-controller-6-6.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/compat/wordpress-6.6/class-gutenberg-rest-templates-controller-6-6.php b/lib/compat/wordpress-6.6/class-gutenberg-rest-templates-controller-6-6.php index 4d186436539ba7..9fdcb7302c7e99 100644 --- a/lib/compat/wordpress-6.6/class-gutenberg-rest-templates-controller-6-6.php +++ b/lib/compat/wordpress-6.6/class-gutenberg-rest-templates-controller-6-6.php @@ -162,7 +162,7 @@ public function update_item( $request ) { wp_delete_post( $template->wp_id, true ); $request->set_param( 'context', 'edit' ); - $template = get_block_template( $request['id'], $this->post_type ); + $template = gutenberg_get_block_template( $request['id'], $this->post_type ); $response = $this->prepare_item_for_response( $template, $request ); return rest_ensure_response( $response ); @@ -534,7 +534,7 @@ private static function get_wp_templates_author_text_field( $template_object ) { case 'plugin': $plugins = get_plugins(); $plugin_name = isset( $template_object->plugin ) ? $template_object->plugin . '/' . $template_object->plugin : $template_object->theme; - $plugin = $plugins[ plugin_basename( sanitize_text_field( $plugin_name . '.php' ) ) ]; + $plugin = $plugins[ plugin_basename( sanitize_text_field( $plugin_name . '.php' ) ) ]; return empty( $plugin['Name'] ) ? $template_object->theme : $plugin['Name']; case 'site': return get_bloginfo( 'name' );