diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-taxonomies-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-taxonomies-controller.php
index 1438481..8b245dd 100644
|
a
|
b
|
class WP_REST_Taxonomies_Controller extends WP_REST_Controller { |
| 191 | 191 | 'show_cloud' => $taxonomy->show_tagcloud, |
| 192 | 192 | 'hierarchical' => $taxonomy->hierarchical, |
| 193 | 193 | 'rest_base' => $base, |
| | 194 | 'visibility' => array( |
| | 195 | 'public' => (bool) $taxonomy->public, |
| | 196 | 'publicly_queryable' => (bool) $taxonomy->publicly_queryable, |
| | 197 | 'show_admin_column' => (bool) $taxonomy->show_admin_column, |
| | 198 | 'show_in_nav_menus' => (bool) $taxonomy->show_in_nav_menus, |
| | 199 | 'show_in_quick_edit' => (bool) $taxonomy->show_in_quick_edit, |
| | 200 | 'show_ui' => (bool) $taxonomy->show_ui, |
| | 201 | ), |
| 194 | 202 | ); |
| 195 | 203 | |
| 196 | 204 | $context = ! empty( $request['context'] ) ? $request['context'] : 'view'; |
| | 205 | |
| 197 | 206 | $data = $this->add_additional_fields_to_object( $data, $request ); |
| 198 | 207 | $data = $this->filter_response_by_context( $data, $context ); |
| 199 | 208 | |
| … |
… |
class WP_REST_Taxonomies_Controller extends WP_REST_Controller { |
| 295 | 304 | 'context' => array( 'view', 'edit', 'embed' ), |
| 296 | 305 | 'readonly' => true, |
| 297 | 306 | ), |
| | 307 | 'visibility' => array( |
| | 308 | 'description' => __( 'The visibility settings for the taxomonmy.' ), |
| | 309 | 'type' => 'object', |
| | 310 | 'context' => array( 'edit' ), |
| | 311 | 'readonly' => true, |
| | 312 | 'properties' => array( |
| | 313 | 'public' => array( |
| | 314 | 'descriptoin' => 'Whether a taxonomy is intended for use publicly either via the admin interface or by front-end users.', |
| | 315 | 'type' => 'boolean', |
| | 316 | ), |
| | 317 | 'publicly_queryable' => array( |
| | 318 | 'descriptoin' => 'Whether the taxonomy is publicly queryable.', |
| | 319 | 'type' => 'boolean', |
| | 320 | ), |
| | 321 | 'show_ui' => array( |
| | 322 | 'descriptoin' => 'Whether to generate a default UI for managing this taxonomy.', |
| | 323 | 'type' => 'boolean', |
| | 324 | ), |
| | 325 | 'show_admin_column' => array( |
| | 326 | 'descriptoin' => 'Whether to allow automatic creation of taxonomy columns on associated post-types table.', |
| | 327 | 'type' => 'boolean', |
| | 328 | ), |
| | 329 | 'show_in_nav_menus' => array( |
| | 330 | 'descriptoin' => 'Whetgher to make the taxonomy available for selection in navigation menus.', |
| | 331 | 'type' => 'boolean', |
| | 332 | ), |
| | 333 | 'show_in_quick_edit' => array( |
| | 334 | 'descriptoin' => 'Whether to show the taxonomy in the quick/bulk edit panel.', |
| | 335 | 'type' => 'boolean', |
| | 336 | ), |
| | 337 | |
| | 338 | ), |
| | 339 | ), |
| 298 | 340 | ), |
| 299 | 341 | ); |
| 300 | 342 | return $this->add_additional_fields_schema( $schema ); |
diff --git a/tests/phpunit/tests/rest-api/rest-taxonomies-controller.php b/tests/phpunit/tests/rest-api/rest-taxonomies-controller.php
index 205a041..b86acf3 100644
|
a
|
b
|
class WP_Test_REST_Taxonomies_Controller extends WP_Test_REST_Controller_Testcas |
| 144 | 144 | $response = $this->server->dispatch( $request ); |
| 145 | 145 | $data = $response->get_data(); |
| 146 | 146 | $properties = $data['schema']['properties']; |
| 147 | | $this->assertEquals( 9, count( $properties ) ); |
| | 147 | $this->assertEquals( 10, count( $properties ) ); |
| 148 | 148 | $this->assertArrayHasKey( 'capabilities', $properties ); |
| 149 | 149 | $this->assertArrayHasKey( 'description', $properties ); |
| 150 | 150 | $this->assertArrayHasKey( 'hierarchical', $properties ); |
| … |
… |
class WP_Test_REST_Taxonomies_Controller extends WP_Test_REST_Controller_Testcas |
| 153 | 153 | $this->assertArrayHasKey( 'slug', $properties ); |
| 154 | 154 | $this->assertArrayHasKey( 'show_cloud', $properties ); |
| 155 | 155 | $this->assertArrayHasKey( 'types', $properties ); |
| | 156 | $this->assertArrayHasKey( 'visibility', $properties ); |
| 156 | 157 | $this->assertArrayHasKey( 'rest_base', $properties ); |
| 157 | 158 | } |
| 158 | 159 | |
| … |
… |
class WP_Test_REST_Taxonomies_Controller extends WP_Test_REST_Controller_Testcas |
| 186 | 187 | $this->assertEquals( $tax_obj->cap, $data['capabilities'] ); |
| 187 | 188 | $this->assertEquals( $tax_obj->labels, $data['labels'] ); |
| 188 | 189 | $this->assertEquals( $tax_obj->show_tagcloud, $data['show_cloud'] ); |
| | 190 | |
| | 191 | $this->assertEquals( $tax_obj->public, $data['visibility']['public'] ); |
| | 192 | $this->assertEquals( $tax_obj->publicly_queryable, $data['visibility']['publicly_queryable'] ); |
| | 193 | $this->assertEquals( $tax_obj->show_admin_column, $data['visibility']['show_admin_column'] ); |
| | 194 | $this->assertEquals( $tax_obj->show_in_nav_menus, $data['visibility']['show_in_nav_menus'] ); |
| | 195 | $this->assertEquals( $tax_obj->show_in_quick_edit, $data['visibility']['show_in_quick_edit'] ); |
| | 196 | $this->assertEquals( $tax_obj->show_ui, $data['visibility']['show_ui'] ); |
| 189 | 197 | } else { |
| 190 | 198 | $this->assertFalse( isset( $data['capabilities'] ) ); |
| 191 | 199 | $this->assertFalse( isset( $data['labels'] ) ); |
| 192 | 200 | $this->assertFalse( isset( $data['show_cloud'] ) ); |
| | 201 | $this->assertFalse( isset( $data['visibility'] ) ); |
| 193 | 202 | } |
| 194 | 203 | } |
| 195 | 204 | |