- Timestamp:
- 07/10/2023 11:17:05 PM (15 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-templates-controller.php
r56051 r56195 102 102 '/%s/(?P<id>%s%s)', 103 103 $this->rest_base, 104 // Matches theme's directory: `/themes/<subdirectory>/<theme>/` or `/themes/<theme>/`. 105 // Excludes invalid directory name characters: `/:<>*?"|`. 104 /* 105 * Matches theme's directory: `/themes/<subdirectory>/<theme>/` or `/themes/<theme>/`. 106 * Excludes invalid directory name characters: `/:<>*?"|`. 107 */ 106 108 '([^\/:<>\*\?"\|]+(?:\/[^\/:<>\*\?"\|]+)?)', 107 109 // Matches the template name. … … 178 180 */ 179 181 protected function permissions_check( $request ) { 180 // Verify if the current user has edit_theme_options capability. 181 // This capability is required to edit/view/delete templates. 182 /* 183 * Verify if the current user has edit_theme_options capability. 184 * This capability is required to edit/view/delete templates. 185 */ 182 186 if ( ! current_user_can( 'edit_theme_options' ) ) { 183 187 return new WP_Error( … … 503 507 } 504 508 505 // (Note that internally this falls through to `wp_delete_post()` 506 // if the Trash is disabled.) 509 /* 510 * (Note that internally this falls through to `wp_delete_post()` 511 * if the Trash is disabled.) 512 */ 507 513 $result = wp_trash_post( $id ); 508 514 $template->status = 'trash';
Note: See TracChangeset
for help on using the changeset viewer.