Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-post-types-controller.php
r39342 r39647 150 150 $taxonomies = wp_list_pluck( $taxonomies, 'name' ); 151 151 $base = ! empty( $post_type->rest_base ) ? $post_type->rest_base : $post_type->name; 152 $supports = get_all_post_type_supports( $post_type->name ); 153 152 154 $data = array( 153 155 'capabilities' => $post_type->cap, … … 157 159 'name' => $post_type->label, 158 160 'slug' => $post_type->name, 161 'supports' => $supports, 159 162 'taxonomies' => array_values( $taxonomies ), 160 163 'rest_base' => $base, … … 240 243 'readonly' => true, 241 244 ), 245 'supports' => array( 246 'description' => __( 'All features, supported by the post type.' ), 247 'type' => 'object', 248 'context' => array( 'edit' ), 249 'readonly' => true, 250 ), 242 251 'taxonomies' => array( 243 252 'description' => __( 'Taxonomies associated with post type.' ), -
trunk/tests/phpunit/tests/rest-api/rest-post-types-controller.php
r39191 r39647 120 120 $data = $response->get_data(); 121 121 $properties = $data['schema']['properties']; 122 $this->assertEquals( 8, count( $properties ) );122 $this->assertEquals( 9, count( $properties ) ); 123 123 $this->assertArrayHasKey( 'capabilities', $properties ); 124 124 $this->assertArrayHasKey( 'description', $properties ); … … 127 127 $this->assertArrayHasKey( 'name', $properties ); 128 128 $this->assertArrayHasKey( 'slug', $properties ); 129 $this->assertArrayHasKey( 'supports', $properties ); 129 130 $this->assertArrayHasKey( 'taxonomies', $properties ); 130 131 $this->assertArrayHasKey( 'rest_base', $properties ); … … 180 181 $this->assertEquals( $post_type_obj->cap, $data['capabilities'] ); 181 182 $this->assertEquals( $post_type_obj->labels, $data['labels'] ); 183 $this->assertEquals( get_all_post_type_supports( $post_type_obj->name ), $data['supports'] ); 182 184 } else { 183 185 $this->assertFalse( isset( $data['capabilities'] ) ); 184 186 $this->assertFalse( isset( $data['labels'] ) ); 187 $this->assertFalse( isset( $data['supports'] ) ); 185 188 } 186 189 }
Note: See TracChangeset
for help on using the changeset viewer.