Changeset 58452
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-post-types-controller.php
r56586 r58452 245 245 if ( rest_is_field_included( 'rest_namespace', $fields ) ) { 246 246 $data['rest_namespace'] = $namespace; 247 248 249 250 251 252 253 254 247 255 } 248 256 … … 408 416 'readonly' => true, 409 417 ), 418 419 420 421 422 423 424 425 426 427 428 429 430 410 431 ), 411 432 ); -
trunk/tests/phpunit/tests/rest-api/rest-post-types-controller.php
r56746 r58452 78 78 } 79 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 80 101 public function test_get_item_page() { 81 102 $request = new WP_REST_Request( 'GET', '/wp/v2/types/page' ); … … 166 187 $properties = $data['schema']['properties']; 167 188 168 $this->assertCount( 1 4, $properties, 'Schema should have 14properties' );189 $this->assertCount( 1 properties' ); 169 190 $this->assertArrayHasKey( 'capabilities', $properties, '`capabilities` should be included in the schema' ); 170 191 $this->assertArrayHasKey( 'description', $properties, '`description` should be included in the schema' ); … … 181 202 $this->assertArrayHasKey( 'visibility', $properties, '`visibility` should be included in the schema' ); 182 203 $this->assertArrayHasKey( 'icon', $properties, '`icon` should be included in the schema' ); 204 205 183 206 } 184 207 … … 231 254 $this->assertSame( $post_type_obj->rest_namespace, $data['rest_namespace'] ); 232 255 $this->assertSame( $post_type_obj->has_archive, $data['has_archive'] ); 256 257 233 258 234 259 $links = test_rest_expand_compact_links( $links ); -
trunk/tests/qunit/fixtures/wp-api-generated.js
r58340 r58452 13015 13015 "rest_base": "posts", 13016 13016 "rest_namespace": "wp/v2", 13017 13018 13017 13019 "_links": { 13018 13020 "collection": [ … … 13045 13047 "rest_base": "pages", 13046 13048 "rest_namespace": "wp/v2", 13049 13050 13047 13051 "_links": { 13048 13052 "collection": [ … … 13075 13079 "rest_base": "media", 13076 13080 "rest_namespace": "wp/v2", 13081 13082 13077 13083 "_links": { 13078 13084 "collection": [ … … 13107 13113 "rest_base": "menu-items", 13108 13114 "rest_namespace": "wp/v2", 13115 13116 13109 13117 "_links": { 13110 13118 "collection": [ … … 13139 13147 "rest_base": "blocks", 13140 13148 "rest_namespace": "wp/v2", 13149 13150 13141 13151 "_links": { 13142 13152 "collection": [ … … 13169 13179 "rest_base": "templates", 13170 13180 "rest_namespace": "wp/v2", 13181 13182 13171 13183 "_links": { 13172 13184 "collection": [ … … 13199 13211 "rest_base": "template-parts", 13200 13212 "rest_namespace": "wp/v2", 13213 13214 13201 13215 "_links": { 13202 13216 "collection": [ … … 13229 13243 "rest_base": "global-styles", 13230 13244 "rest_namespace": "wp/v2", 13245 13246 13231 13247 "_links": { 13232 13248 "collection": [ … … 13259 13275 "rest_base": "navigation", 13260 13276 "rest_namespace": "wp/v2", 13277 13278 13261 13279 "_links": { 13262 13280 "collection": [ … … 13289 13307 "rest_base": "font-families", 13290 13308 "rest_namespace": "wp/v2", 13309 13310 13291 13311 "_links": { 13292 13312 "collection": [ … … 13319 13339 "rest_base": "font-families/(?P<font_family_id>[\\d]+)/font-faces", 13320 13340 "rest_namespace": "wp/v2", 13341 13342 13321 13343 "_links": { 13322 13344 "collection": [ … … 13353 13375 ], 13354 13376 "rest_base": "posts", 13355 "rest_namespace": "wp/v2" 13377 "rest_namespace": "wp/v2", 13378 "template": [], 13379 "template_lock": false 13356 13380 }; 13357 13381
Note: See TracChangeset
for help on using the changeset viewer.