Changeset 52399 for trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php
- Timestamp:
- 12/21/2021 04:12:06 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php
r52376 r52399 42 42 register_rest_route( 43 43 $this->namespace, 44 '/' . $this->rest_base . '/themes/(?P<stylesheet>[\/\s%\w\.\(\)\[\]\@_\-]+)', 44 // The route. 45 sprintf( 46 '/%s/themes/(?P<stylesheet>%s)', 47 $this->rest_base, 48 // Matches theme's directory: `/themes/<subdirectory>/<theme>/` or `/themes/<theme>/`. 49 // Excludes invalid directory name characters: `/:<>*?"|`. 50 '[^\/:<>\*\?"\|]+(?:\/[^\/:<>\*\?"\|]+)?' 51 ), 45 52 array( 46 53 array( … … 62 69 register_rest_route( 63 70 $this->namespace, 64 '/' . $this->rest_base . '/(?P<id>[\/\ s%\w\.\(\)\[\]\@_\-]+)',71 '/' . $this->rest_base . '/(?P<id>[\/\w-]+)', 65 72 array( 66 73 array( … … 89 96 /** 90 97 * Sanitize the global styles ID or stylesheet to decode endpoint. 91 * For example, `wp/v2/global-styles/t emplatetwentytwo%200.4.0`92 * would be decoded to `t emplatetwentytwo 0.4.0`.98 * For example, `wp/v2/global-styles/twentytwentytwo%200.4.0` 99 * would be decoded to `twentytwentytwo 0.4.0`. 93 100 * 94 101 * @since 5.9.0
Note: See TracChangeset
for help on using the changeset viewer.