X7ROOT File Manager
Current Path:
/home/okeydcqc/.trash/old.1/wp-includes/rest-api/endpoints
home
/
okeydcqc
/
.trash
/
old.1
/
wp-includes
/
rest-api
/
endpoints
/
ðŸ“
..
📄
class-wp-rest-application-passwords-controller.php
(23.59 KB)
📄
class-wp-rest-attachments-controller.php
(43.16 KB)
📄
class-wp-rest-autosaves-controller.php
(13.09 KB)
📄
class-wp-rest-block-directory-controller.php
(9.72 KB)
📄
class-wp-rest-block-pattern-categories-controller.php
(4.55 KB)
📄
class-wp-rest-block-patterns-controller.php
(8.81 KB)
📄
class-wp-rest-block-renderer-controller.php
(5.7 KB)
📄
class-wp-rest-block-types-controller.php
(23.78 KB)
📄
class-wp-rest-blocks-controller.php
(3.08 KB)
📄
class-wp-rest-comments-controller.php
(56.18 KB)
📄
class-wp-rest-controller.php
(18.62 KB)
📄
class-wp-rest-edit-site-export-controller.php
(2.07 KB)
📄
class-wp-rest-global-styles-controller.php
(20.17 KB)
📄
class-wp-rest-global-styles-revisions-controller.php
(13.92 KB)
📄
class-wp-rest-menu-items-controller.php
(31.63 KB)
📄
class-wp-rest-menu-locations-controller.php
(8.32 KB)
📄
class-wp-rest-menus-controller.php
(16.42 KB)
📄
class-wp-rest-navigation-fallback-controller.php
(5.07 KB)
📄
class-wp-rest-pattern-directory-controller.php
(12.89 KB)
📄
class-wp-rest-plugins-controller.php
(27.86 KB)
📄
class-wp-rest-post-statuses-controller.php
(10.08 KB)
📄
class-wp-rest-post-types-controller.php
(12.63 KB)
📄
class-wp-rest-posts-controller.php
(94.78 KB)
📄
class-wp-rest-revisions-controller.php
(24.29 KB)
📄
class-wp-rest-search-controller.php
(11.04 KB)
📄
class-wp-rest-settings-controller.php
(10.05 KB)
📄
class-wp-rest-sidebars-controller.php
(15.36 KB)
📄
class-wp-rest-site-health-controller.php
(9.62 KB)
📄
class-wp-rest-taxonomies-controller.php
(13.23 KB)
📄
class-wp-rest-templates-controller.php
(29.74 KB)
📄
class-wp-rest-terms-controller.php
(33.17 KB)
📄
class-wp-rest-themes-controller.php
(19.39 KB)
📄
class-wp-rest-url-details-controller.php
(20.07 KB)
📄
class-wp-rest-users-controller.php
(46.38 KB)
📄
class-wp-rest-widget-types-controller.php
(18.32 KB)
📄
class-wp-rest-widgets-controller.php
(25.86 KB)
Editing: class-wp-rest-edit-site-export-controller.php
<?php /** * REST API: WP_REST_Edit_Site_Export_Controller class * * @package WordPress * @subpackage REST_API */ /** * Controller which provides REST endpoint for exporting current templates * and template parts. * * @since 5.9.0 * * @see WP_REST_Controller */ class WP_REST_Edit_Site_Export_Controller extends WP_REST_Controller { /** * Constructor. * * @since 5.9.0 */ public function __construct() { $this->namespace = 'wp-block-editor/v1'; $this->rest_base = 'export'; } /** * Registers the site export route. * * @since 5.9.0 */ public function register_routes() { register_rest_route( $this->namespace, '/' . $this->rest_base, array( array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'export' ), 'permission_callback' => array( $this, 'permissions_check' ), ), ) ); } /** * Checks whether a given request has permission to export. * * @since 5.9.0 * * @return WP_Error|true True if the request has access, or WP_Error object. */ public function permissions_check() { if ( current_user_can( 'edit_theme_options' ) ) { return true; } return new WP_Error( 'rest_cannot_export_templates', __( 'Sorry, you are not allowed to export templates and template parts.' ), array( 'status' => rest_authorization_required_code() ) ); } /** * Output a ZIP file with an export of the current templates * and template parts from the site editor, and close the connection. * * @since 5.9.0 * * @return WP_Error|void */ public function export() { // Generate the export file. $filename = wp_generate_block_templates_export_file(); if ( is_wp_error( $filename ) ) { $filename->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; } }
Upload File
Create Folder