Changeset 42729
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-taxonomies-controller.php
r42343 r42729 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 … … 296 304 'readonly' => true, 297 305 ), 306 'visibility' => array( 307 'description' => __( 'The visibility settings for the taxomonmy.' ), 308 'type' => 'object', 309 'context' => array( 'edit' ), 310 'readonly' => true, 311 'properties' => array( 312 'public' => array( 313 'description' => 'Whether a taxonomy is intended for use publicly either via the admin interface or by front-end users.', 314 'type' => 'boolean', 315 ), 316 'publicly_queryable' => array( 317 'description' => 'Whether the taxonomy is publicly queryable.', 318 'type' => 'boolean', 319 ), 320 'show_ui' => array( 321 'description' => 'Whether to generate a default UI for managing this taxonomy.', 322 'type' => 'boolean', 323 ), 324 'show_admin_column' => array( 325 'description' => 'Whether to allow automatic creation of taxonomy columns on associated post-types table.', 326 'type' => 'boolean', 327 ), 328 'show_in_nav_menus' => array( 329 'description' => 'Whether to make the taxonomy available for selection in navigation menus.', 330 'type' => 'boolean', 331 ), 332 'show_in_quick_edit' => array( 333 'description' => 'Whether to show the taxonomy in the quick/bulk edit panel.', 334 'type' => 'boolean', 335 ), 336 337 ), 338 ), 298 339 ), 299 340 ); -
trunk/tests/phpunit/tests/rest-api/rest-taxonomies-controller.php
r42724 r42729 124 124 } 125 125 126 126 public function test_get_non_public_taxonomy_no_permission() { 127 127 wp_set_current_user( self::$contributor_id ); 128 128 register_taxonomy( 'api-private', 'post', array( 'public' => false ) ); … … 168 168 $data = $response->get_data(); 169 169 $properties = $data['schema']['properties']; 170 $this->assertEquals( 9, count( $properties ) );170 $this->assertEquals( 10, count( $properties ) ); 171 171 $this->assertArrayHasKey( 'capabilities', $properties ); 172 172 $this->assertArrayHasKey( 'description', $properties ); … … 177 177 $this->assertArrayHasKey( 'show_cloud', $properties ); 178 178 $this->assertArrayHasKey( 'types', $properties ); 179 $this->assertArrayHasKey( 'visibility', $properties ); 179 180 $this->assertArrayHasKey( 'rest_base', $properties ); 180 181 } … … 210 211 $this->assertEquals( $tax_obj->labels, $data['labels'] ); 211 212 $this->assertEquals( $tax_obj->show_tagcloud, $data['show_cloud'] ); 213 214 $this->assertEquals( $tax_obj->public, $data['visibility']['public'] ); 215 $this->assertEquals( $tax_obj->publicly_queryable, $data['visibility']['publicly_queryable'] ); 216 $this->assertEquals( $tax_obj->show_admin_column, $data['visibility']['show_admin_column'] ); 217 $this->assertEquals( $tax_obj->show_in_nav_menus, $data['visibility']['show_in_nav_menus'] ); 218 $this->assertEquals( $tax_obj->show_in_quick_edit, $data['visibility']['show_in_quick_edit'] ); 219 $this->assertEquals( $tax_obj->show_ui, $data['visibility']['show_ui'] ); 212 220 } else { 213 221 $this->assertFalse( isset( $data['capabilities'] ) ); 214 222 $this->assertFalse( isset( $data['labels'] ) ); 215 223 $this->assertFalse( isset( $data['show_cloud'] ) ); 224 $this->assertFalse( isset( $data['visibility'] ) ); 216 225 } 217 226 }
Note: See TracChangeset
for help on using the changeset viewer.