Changeset 39097 for trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-post-types-controller.php
- Timestamp:
- 11/02/2016 09:50:08 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-post-types-controller.php
r39025 r39097 147 147 */ 148 148 public function prepare_item_for_response( $post_type, $request ) { 149 $taxonomies = wp_list_filter( get_object_taxonomies( $post_type->name, 'objects' ), array( 'show_in_rest' => true ) ); 150 $taxonomies = wp_list_pluck( $taxonomies, 'name' ); 149 151 $data = array( 150 152 'capabilities' => $post_type->cap, … … 154 156 'name' => $post_type->label, 155 157 'slug' => $post_type->name, 158 'taxonomies' => array_values( $taxonomies ), 156 159 ); 157 160 $context = ! empty( $request['context'] ) ? $request['context'] : 'view'; … … 204 207 'description' => __( 'All capabilities used by the resource.' ), 205 208 'type' => 'array', 209 'items' => array( 210 'type' => 'string', 211 ), 206 212 'context' => array( 'edit' ), 207 213 'readonly' => true, … … 237 243 'readonly' => true, 238 244 ), 245 'taxonomies' => array( 246 'description' => __( 'Taxonomies associated with resource.' ), 247 'type' => 'array', 248 'items' => array( 249 'type' => 'string', 250 ), 251 'context' => array( 'view', 'edit' ), 252 'readonly' => true, 253 ), 239 254 ), 240 255 );
Note: See TracChangeset
for help on using the changeset viewer.