Changeset 60359 for trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php
- Timestamp:
- 06/27/2025 08:45:08 PM (14 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php
r59048 r60359 89 89 register_rest_route( 90 90 $this->namespace, 91 '/' . $this->rest_base . '/(?P<id>[\/\ w-]+)',91 '/' . $this->rest_base . '/(?P<id>[\/\d+]+)', 92 92 array( 93 93 array( … … 97 97 'args' => array( 98 98 'id' => array( 99 'description' => __( 'The id of a template' ), 100 'type' => 'string', 101 'sanitize_callback' => array( $this, '_sanitize_global_styles_callback' ), 99 'description' => __( 'ID of global styles config.' ), 100 'type' => 'integer', 102 101 ), 103 102 ), … … 116 115 117 116 /** 118 * Sanitize the global styles ID orstylesheet to decode endpoint.117 * Sanitize the global styles stylesheet to decode endpoint. 119 118 * For example, `wp/v2/global-styles/twentytwentytwo%200.4.0` 120 119 * would be decoded to `twentytwentytwo 0.4.0`. … … 122 121 * @since 5.9.0 123 122 * 124 * @param string $ id_or_stylesheet Global styles ID orstylesheet.125 * @return string Sanitized global styles ID orstylesheet.126 */ 127 public function _sanitize_global_styles_callback( $ id_or_stylesheet ) {128 return urldecode( $ id_or_stylesheet );123 * @param string $stylesheet Global styles stylesheet. 124 * @return string Sanitized global styles stylesheet. 125 */ 126 public function _sanitize_global_styles_callback( $stylesheet ) { 127 return urldecode( $stylesheet ); 129 128 } 130 129 … … 140 139 $error = new WP_Error( 141 140 'rest_global_styles_not_found', 142 __( 'No global styles config exist with that id.' ),141 __( 'No global styles config exists with that ID.' ), 143 142 array( 'status' => 404 ) 144 143 ); … … 465 464 'id' => array( 466 465 'description' => __( 'ID of global styles config.' ), 467 'type' => ' string',466 'type' => 'integer', 468 467 'context' => array( 'embed', 'view', 'edit' ), 469 468 'readonly' => true,
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)