Changeset 55294
- Timestamp:
- 02/07/2023 11:45:18 PM (22 months ago)
- Location:
- trunk
- Files:
-
- 11 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-templates-controller.php
r54817 r55294 106 106 '([^\/:<>\*\?"\|]+(?:\/[^\/:<>\*\?"\|]+)?)', 107 107 // Matches the template name. 108 '[\/\w -]+'108 '[\/\w%-]+' 109 109 ), 110 110 array( … … 835 835 'required' => true, 836 836 'minLength' => 1, 837 'pattern' => '[a-zA-Z0-9_\ -]+',837 'pattern' => '[a-zA-Z0-9_\%-]+', 838 838 ), 839 839 'theme' => array( -
trunk/tests/phpunit/tests/rest-api/rest-schema-setup.php
r55029 r55294 147 147 '/wp/v2/template-parts', 148 148 '/wp/v2/template-parts/(?P<id>[\d]+)/autosaves', 149 '/wp/v2/template-parts/(?P<id>([^\/:<>\*\?"\|]+(?:\/[^\/:<>\*\?"\|]+)?)[\/\w -]+)',149 '/wp/v2/template-parts/(?P<id>([^\/:<>\*\?"\|]+(?:\/[^\/:<>\*\?"\|]+)?)[\/\w%-]+)', 150 150 '/wp/v2/template-parts/(?P<parent>[\d]+)/autosaves/(?P<id>[\d]+)', 151 151 '/wp/v2/template-parts/(?P<parent>[\d]+)/revisions', … … 154 154 '/wp/v2/templates', 155 155 '/wp/v2/templates/(?P<id>[\d]+)/autosaves', 156 '/wp/v2/templates/(?P<id>([^\/:<>\*\?"\|]+(?:\/[^\/:<>\*\?"\|]+)?)[\/\w -]+)',156 '/wp/v2/templates/(?P<id>([^\/:<>\*\?"\|]+(?:\/[^\/:<>\*\?"\|]+)?)[\/\w%-]+)', 157 157 '/wp/v2/templates/(?P<parent>[\d]+)/autosaves/(?P<id>[\d]+)', 158 158 '/wp/v2/templates/(?P<parent>[\d]+)/revisions', -
trunk/tests/phpunit/tests/rest-api/wpRestTemplatesController.php
r54402 r55294 67 67 ); 68 68 $this->assertArrayHasKey( 69 '/wp/v2/templates/(?P<id>([^\/:<>\*\?"\|]+(?:\/[^\/:<>\*\?"\|]+)?)[\/\w -]+)',69 '/wp/v2/templates/(?P<id>([^\/:<>\*\?"\|]+(?:\/[^\/:<>\*\?"\|]+)?)[\/\w%-]+)', 70 70 $routes, 71 71 'Single template based on the given ID route does not exist' … … 293 293 'post_content' => file_get_contents( $theme_root_dir . 'block-theme/templates/page-home.html' ), 294 294 'post_excerpt' => 'Description of page home template.', 295 ), 296 ), 297 'template parts: parent theme with non latin characters' => array( 298 'theme_dir' => 'themedir1/block-theme-non-latin', 299 'template' => 'small-header-%cf%84%ce%b5%cf%83%cf%84', 300 'args' => array( 301 'post_name' => 'small-header-τεστ', 302 'post_title' => 'Small Header τεστ Template', 303 'post_content' => file_get_contents( $theme_root_dir . '/block-theme-non-latin/parts/small-header-τεστ.html' ), 304 'post_excerpt' => 'Description of small header τεστ template.', 305 ), 306 ), 307 'template: parent theme with non latin name' => array( 308 'theme_dir' => 'themedir1/block-theme-non-latin', 309 'template' => 'page-%cf%84%ce%b5%cf%83%cf%84', 310 'args' => array( 311 'post_name' => 'page-τεστ', 312 'post_title' => 'τεστ Page Template', 313 'post_content' => file_get_contents( $theme_root_dir . 'block-theme-non-latin/templates/page-τεστ.html' ), 314 'post_excerpt' => 'Description of page τεστ template.', 315 ), 316 ), 317 'template parts: parent theme with chinese characters' => array( 318 'theme_dir' => 'themedir1/block-theme-non-latin', 319 'template' => 'small-header-%e6%b5%8b%e8%af%95', 320 'args' => array( 321 'post_name' => 'small-header-测试', 322 'post_title' => 'Small Header 测试 Template', 323 'post_content' => file_get_contents( $theme_root_dir . '/block-theme-non-latin/parts/small-header-测试.html' ), 324 'post_excerpt' => 'Description of small header 测试 template.', 325 ), 326 ), 327 'template: parent theme with non latin name using chinese characters' => array( 328 'theme_dir' => 'themedir1/block-theme-non-latin', 329 'template' => 'page-%e6%b5%8b%e8%af%95', 330 'args' => array( 331 'post_name' => 'page-测试', 332 'post_title' => '测试 Page Template', 333 'post_content' => file_get_contents( $theme_root_dir . 'block-theme-non-latin/templates/page-测试.html' ), 334 'post_excerpt' => 'Description of page 测试 template.', 295 335 ), 296 336 ), -
trunk/tests/phpunit/tests/theme/themeDir.php
r55133 r55294 182 182 'Block Theme Child Theme With Fluid Typography', 183 183 'Block Theme Child Theme With Fluid Typography Config', 184 'Block Theme Non Latin', 184 185 'Block Theme [0.4.0]', 185 186 'Block Theme [1.0.0] in subdirectory', -
trunk/tests/qunit/fixtures/wp-api-generated.js
r55248 r55294 5106 5106 "type": "string", 5107 5107 "minLength": 1, 5108 "pattern": "[a-zA-Z0-9_\\ -]+",5108 "pattern": "[a-zA-Z0-9_\\%-]+", 5109 5109 "required": true 5110 5110 }, … … 5248 5248 } 5249 5249 }, 5250 "/wp/v2/templates/(?P<id>([^\\/:<>\\*\\?\"\\|]+(?:\\/[^\\/:<>\\*\\?\"\\|]+)?)[\\/\\w -]+)": {5250 "/wp/v2/templates/(?P<id>([^\\/:<>\\*\\?\"\\|]+(?:\\/[^\\/:<>\\*\\?\"\\|]+)?)[\\/\\w%-]+)": { 5251 5251 "namespace": "wp/v2", 5252 5252 "methods": [ … … 5297 5297 "type": "string", 5298 5298 "minLength": 1, 5299 "pattern": "[a-zA-Z0-9_\\ -]+",5299 "pattern": "[a-zA-Z0-9_\\%-]+", 5300 5300 "required": false 5301 5301 }, … … 5611 5611 "type": "string", 5612 5612 "minLength": 1, 5613 "pattern": "[a-zA-Z0-9_\\ -]+",5613 "pattern": "[a-zA-Z0-9_\\%-]+", 5614 5614 "required": false 5615 5615 }, … … 5790 5790 "type": "string", 5791 5791 "minLength": 1, 5792 "pattern": "[a-zA-Z0-9_\\ -]+",5792 "pattern": "[a-zA-Z0-9_\\%-]+", 5793 5793 "required": true 5794 5794 }, … … 5937 5937 } 5938 5938 }, 5939 "/wp/v2/template-parts/(?P<id>([^\\/:<>\\*\\?\"\\|]+(?:\\/[^\\/:<>\\*\\?\"\\|]+)?)[\\/\\w -]+)": {5939 "/wp/v2/template-parts/(?P<id>([^\\/:<>\\*\\?\"\\|]+(?:\\/[^\\/:<>\\*\\?\"\\|]+)?)[\\/\\w%-]+)": { 5940 5940 "namespace": "wp/v2", 5941 5941 "methods": [ … … 5986 5986 "type": "string", 5987 5987 "minLength": 1, 5988 "pattern": "[a-zA-Z0-9_\\ -]+",5988 "pattern": "[a-zA-Z0-9_\\%-]+", 5989 5989 "required": false 5990 5990 }, … … 6305 6305 "type": "string", 6306 6306 "minLength": 1, 6307 "pattern": "[a-zA-Z0-9_\\ -]+",6307 "pattern": "[a-zA-Z0-9_\\%-]+", 6308 6308 "required": false 6309 6309 },
Note: See TracChangeset
for help on using the changeset viewer.