From cb78c2a876bc38653b0dc0a0268efcc14ff2b238 Mon Sep 17 00:00:00 2001 From: ramon Date: Fri, 10 May 2024 17:15:00 +1000 Subject: [PATCH] Add the file and lint --- ...g-rest-edit-site-export-controller-6-6.php | 46 +++++++++++++++++++ lib/compat/wordpress-6.6/rest-api.php | 2 +- lib/load.php | 4 +- 3 files changed, 49 insertions(+), 3 deletions(-) create mode 100644 lib/compat/wordpress-6.6/class-gutenberg-rest-edit-site-export-controller-6-6.php diff --git a/lib/compat/wordpress-6.6/class-gutenberg-rest-edit-site-export-controller-6-6.php b/lib/compat/wordpress-6.6/class-gutenberg-rest-edit-site-export-controller-6-6.php new file mode 100644 index 00000000000000..f0a42badccda04 --- /dev/null +++ b/lib/compat/wordpress-6.6/class-gutenberg-rest-edit-site-export-controller-6-6.php @@ -0,0 +1,46 @@ +add_data( array( 'status' => 500 ) ); + + return $filename; + } + + $theme_name = basename( get_stylesheet() ); + header( 'Content-Type: application/zip' ); + header( 'Content-Disposition: attachment; filename=' . $theme_name . '.zip' ); + header( 'Content-Length: ' . filesize( $filename ) ); + flush(); + readfile( $filename ); + unlink( $filename ); + exit; + } +} diff --git a/lib/compat/wordpress-6.6/rest-api.php b/lib/compat/wordpress-6.6/rest-api.php index 3d85949726c5c7..c6c88a8d114809 100644 --- a/lib/compat/wordpress-6.6/rest-api.php +++ b/lib/compat/wordpress-6.6/rest-api.php @@ -78,7 +78,7 @@ function gutenberg_add_class_list_to_public_post_types() { add_action( 'rest_api_init', 'gutenberg_add_class_list_to_public_post_types' ); /** - * Registers the Global Styles Revisions REST API routes. + * Registers the Edit Site Export REST API routes. */ function gutenberg_register_edit_site_export_controller_endpoints() { $edit_site_export_controller = new WP_REST_Edit_Site_Export_Controller_6_6(); diff --git a/lib/load.php b/lib/load.php index 2a08f4a73efaa0..4fa63497652b3e 100644 --- a/lib/load.php +++ b/lib/load.php @@ -46,8 +46,8 @@ function gutenberg_is_experiment_enabled( $name ) { require_once __DIR__ . '/compat/wordpress-6.5/class-gutenberg-rest-global-styles-revisions-controller-6-5.php'; require_once __DIR__ . '/compat/wordpress-6.5/rest-api.php'; - // WordPress 6.6 compat. - require_once __DIR__ . '/compat/wordpress-6.6/class-gutenberg-rest-edit-site-export-controller-6-6.php'; + // WordPress 6.6 compat. + require_once __DIR__ . '/compat/wordpress-6.6/class-gutenberg-rest-edit-site-export-controller-6-6.php'; // Plugin specific code. require_once __DIR__ . '/class-wp-rest-global-styles-controller-gutenberg.php';