mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-12 04:40:26 +00:00
Site Editor: Add site export REST API endpoint.
Add a REST API to export site templates and template part as html files. When the REST API is requested, it responds by downloading a single ZIP file and exits early, without completing full request. To create the exported zip, the ZipArchive class is required. If this class is not present then the export will gracefully fail, returning a `WP_Error` object and 500 status error code. Props spacedmonkey, youknowriad, Mamaduka, walbo, peterwilsoncc. Fixes #54448 . git-svn-id: https://develop.svn.wordpress.org/trunk@52286 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -349,6 +349,10 @@ function create_initial_rest_routes() {
|
||||
// Menu Locations.
|
||||
$controller = new WP_REST_Menu_Locations_Controller();
|
||||
$controller->register_routes();
|
||||
|
||||
// Site Editor Export.
|
||||
$controller = new WP_REST_Edit_Site_Export_Controller();
|
||||
$controller->register_routes();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user