Changeset 56642
- Timestamp:
- 09/21/2023 04:23:12 AM (15 months ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/taxonomy.php
r56585 r56642 221 221 'show_in_nav_menus' => false, 222 222 'show_in_rest' => false, 223 ) 224 ); 225 226 register_taxonomy( 227 'wp_pattern_category', 228 array( 'wp_block' ), 229 array( 230 'public' => true, 231 'publicly_queryable' => false, 232 'hierarchical' => false, 233 'labels' => array( 234 'name' => _x( 'Pattern Categories', 'taxonomy general name' ), 235 'singular_name' => _x( 'Pattern Category', 'taxonomy singular name' ), 236 ), 237 'query_var' => false, 238 'rewrite' => false, 239 'show_ui' => true, 240 '_builtin' => true, 241 'show_in_nav_menus' => false, 242 'show_in_rest' => true, 243 'show_admin_column' => true, 223 244 ) 224 245 ); -
trunk/tests/phpunit/tests/rest-api/rest-schema-setup.php
r56082 r56642 187 187 '/wp-site-health/v1/tests/page-cache', 188 188 '/wp-site-health/v1/directory-sizes', 189 '/wp/v2/wp_pattern_category', 190 '/wp/v2/wp_pattern_category/(?P<id>[\d]+)', 189 191 ); 190 192 -
trunk/tests/phpunit/tests/taxonomy.php
r56548 r56642 11 11 public function test_get_link_taxonomies() { 12 12 $this->assertSame( array( 'link_category' ), get_object_taxonomies( 'link' ) ); 13 } 14 15 public function test_get_block_taxonomies() { 16 $this->assertSame( array( 'wp_pattern_category' ), get_object_taxonomies( 'wp_block' ) ); 13 17 } 14 18 … … 120 124 $this->assertTrue( taxonomy_exists( 'post_tag' ) ); 121 125 $this->assertTrue( taxonomy_exists( 'link_category' ) ); 126 $this->assertTrue( taxonomy_exists( 'wp_pattern_category' ) ); 122 127 } 123 128 -
trunk/tests/qunit/fixtures/wp-api-generated.js
r56296 r56642 4441 4441 }, 4442 4442 "required": false 4443 }, 4444 "tax_relation": { 4445 "description": "Limit result set based on relationship between multiple taxonomies.", 4446 "type": "string", 4447 "enum": [ 4448 "AND", 4449 "OR" 4450 ], 4451 "required": false 4452 }, 4453 "wp_pattern_category": { 4454 "description": "Limit result set to items with specific terms assigned in the wp_pattern_category taxonomy.", 4455 "type": [ 4456 "object", 4457 "array" 4458 ], 4459 "oneOf": [ 4460 { 4461 "title": "Term ID List", 4462 "description": "Match terms with the listed IDs.", 4463 "type": "array", 4464 "items": { 4465 "type": "integer" 4466 } 4467 }, 4468 { 4469 "title": "Term ID Taxonomy Query", 4470 "description": "Perform an advanced term query.", 4471 "type": "object", 4472 "properties": { 4473 "terms": { 4474 "description": "Term IDs.", 4475 "type": "array", 4476 "items": { 4477 "type": "integer" 4478 }, 4479 "default": [] 4480 }, 4481 "operator": { 4482 "description": "Whether items must be assigned all or any of the specified terms.", 4483 "type": "string", 4484 "enum": [ 4485 "AND", 4486 "OR" 4487 ], 4488 "default": "OR" 4489 } 4490 }, 4491 "additionalProperties": false 4492 } 4493 ], 4494 "required": false 4495 }, 4496 "wp_pattern_category_exclude": { 4497 "description": "Limit result set to items except those with specific terms assigned in the wp_pattern_category taxonomy.", 4498 "type": [ 4499 "object", 4500 "array" 4501 ], 4502 "oneOf": [ 4503 { 4504 "title": "Term ID List", 4505 "description": "Match terms with the listed IDs.", 4506 "type": "array", 4507 "items": { 4508 "type": "integer" 4509 } 4510 }, 4511 { 4512 "title": "Term ID Taxonomy Query", 4513 "description": "Perform an advanced term query.", 4514 "type": "object", 4515 "properties": { 4516 "terms": { 4517 "description": "Term IDs.", 4518 "type": "array", 4519 "items": { 4520 "type": "integer" 4521 }, 4522 "default": [] 4523 } 4524 }, 4525 "additionalProperties": false 4526 } 4527 ], 4528 "required": false 4443 4529 } 4444 4530 } … … 4549 4635 "description": "The theme file to use to display the post.", 4550 4636 "type": "string", 4637 "required": false 4638 }, 4639 "wp_pattern_category": { 4640 "description": "The terms assigned to the post in the wp_pattern_category taxonomy.", 4641 "type": "array", 4642 "items": { 4643 "type": "integer" 4644 }, 4551 4645 "required": false 4552 4646 } … … 4712 4806 "type": "string", 4713 4807 "required": false 4808 }, 4809 "wp_pattern_category": { 4810 "description": "The terms assigned to the post in the wp_pattern_category taxonomy.", 4811 "type": "array", 4812 "items": { 4813 "type": "integer" 4814 }, 4815 "required": false 4714 4816 } 4715 4817 } … … 5033 5135 "description": "The theme file to use to display the post.", 5034 5136 "type": "string", 5137 "required": false 5138 }, 5139 "wp_pattern_category": { 5140 "description": "The terms assigned to the post in the wp_pattern_category taxonomy.", 5141 "type": "array", 5142 "items": { 5143 "type": "integer" 5144 }, 5035 5145 "required": false 5036 5146 } … … 8282 8392 ] 8283 8393 }, 8394 "/wp/v2/wp_pattern_category": { 8395 "namespace": "wp/v2", 8396 "methods": [ 8397 "GET", 8398 "POST" 8399 ], 8400 "endpoints": [ 8401 { 8402 "methods": [ 8403 "GET" 8404 ], 8405 "allow_batch": { 8406 "v1": true 8407 }, 8408 "args": { 8409 "context": { 8410 "description": "Scope under which the request is made; determines fields present in response.", 8411 "type": "string", 8412 "enum": [ 8413 "view", 8414 "embed", 8415 "edit" 8416 ], 8417 "default": "view", 8418 "required": false 8419 }, 8420 "page": { 8421 "description": "Current page of the collection.", 8422 "type": "integer", 8423 "default": 1, 8424 "minimum": 1, 8425 "required": false 8426 }, 8427 "per_page": { 8428 "description": "Maximum number of items to be returned in result set.", 8429 "type": "integer", 8430 "default": 10, 8431 "minimum": 1, 8432 "maximum": 100, 8433 "required": false 8434 }, 8435 "search": { 8436 "description": "Limit results to those matching a string.", 8437 "type": "string", 8438 "required": false 8439 }, 8440 "exclude": { 8441 "description": "Ensure result set excludes specific IDs.", 8442 "type": "array", 8443 "items": { 8444 "type": "integer" 8445 }, 8446 "default": [], 8447 "required": false 8448 }, 8449 "include": { 8450 "description": "Limit result set to specific IDs.", 8451 "type": "array", 8452 "items": { 8453 "type": "integer" 8454 }, 8455 "default": [], 8456 "required": false 8457 }, 8458 "offset": { 8459 "description": "Offset the result set by a specific number of items.", 8460 "type": "integer", 8461 "required": false 8462 }, 8463 "order": { 8464 "description": "Order sort attribute ascending or descending.", 8465 "type": "string", 8466 "default": "asc", 8467 "enum": [ 8468 "asc", 8469 "desc" 8470 ], 8471 "required": false 8472 }, 8473 "orderby": { 8474 "description": "Sort collection by term attribute.", 8475 "type": "string", 8476 "default": "name", 8477 "enum": [ 8478 "id", 8479 "include", 8480 "name", 8481 "slug", 8482 "include_slugs", 8483 "term_group", 8484 "description", 8485 "count" 8486 ], 8487 "required": false 8488 }, 8489 "hide_empty": { 8490 "description": "Whether to hide terms not assigned to any posts.", 8491 "type": "boolean", 8492 "default": false, 8493 "required": false 8494 }, 8495 "post": { 8496 "description": "Limit result set to terms assigned to a specific post.", 8497 "type": "integer", 8498 "default": null, 8499 "required": false 8500 }, 8501 "slug": { 8502 "description": "Limit result set to terms with one or more specific slugs.", 8503 "type": "array", 8504 "items": { 8505 "type": "string" 8506 }, 8507 "required": false 8508 } 8509 } 8510 }, 8511 { 8512 "methods": [ 8513 "POST" 8514 ], 8515 "allow_batch": { 8516 "v1": true 8517 }, 8518 "args": { 8519 "description": { 8520 "description": "HTML description of the term.", 8521 "type": "string", 8522 "required": false 8523 }, 8524 "name": { 8525 "description": "HTML title for the term.", 8526 "type": "string", 8527 "required": true 8528 }, 8529 "slug": { 8530 "description": "An alphanumeric identifier for the term unique to its type.", 8531 "type": "string", 8532 "required": false 8533 }, 8534 "meta": { 8535 "description": "Meta fields.", 8536 "type": "object", 8537 "properties": [], 8538 "required": false 8539 } 8540 } 8541 } 8542 ], 8543 "_links": { 8544 "self": [ 8545 { 8546 "href": "http://example.org/index.php?rest_route=/wp/v2/wp_pattern_category" 8547 } 8548 ] 8549 } 8550 }, 8551 "/wp/v2/wp_pattern_category/(?P<id>[\\d]+)": { 8552 "namespace": "wp/v2", 8553 "methods": [ 8554 "GET", 8555 "POST", 8556 "PUT", 8557 "PATCH", 8558 "DELETE" 8559 ], 8560 "endpoints": [ 8561 { 8562 "methods": [ 8563 "GET" 8564 ], 8565 "allow_batch": { 8566 "v1": true 8567 }, 8568 "args": { 8569 "id": { 8570 "description": "Unique identifier for the term.", 8571 "type": "integer", 8572 "required": false 8573 }, 8574 "context": { 8575 "description": "Scope under which the request is made; determines fields present in response.", 8576 "type": "string", 8577 "enum": [ 8578 "view", 8579 "embed", 8580 "edit" 8581 ], 8582 "default": "view", 8583 "required": false 8584 } 8585 } 8586 }, 8587 { 8588 "methods": [ 8589 "POST", 8590 "PUT", 8591 "PATCH" 8592 ], 8593 "allow_batch": { 8594 "v1": true 8595 }, 8596 "args": { 8597 "id": { 8598 "description": "Unique identifier for the term.", 8599 "type": "integer", 8600 "required": false 8601 }, 8602 "description": { 8603 "description": "HTML description of the term.", 8604 "type": "string", 8605 "required": false 8606 }, 8607 "name": { 8608 "description": "HTML title for the term.", 8609 "type": "string", 8610 "required": false 8611 }, 8612 "slug": { 8613 "description": "An alphanumeric identifier for the term unique to its type.", 8614 "type": "string", 8615 "required": false 8616 }, 8617 "meta": { 8618 "description": "Meta fields.", 8619 "type": "object", 8620 "properties": [], 8621 "required": false 8622 } 8623 } 8624 }, 8625 { 8626 "methods": [ 8627 "DELETE" 8628 ], 8629 "allow_batch": { 8630 "v1": true 8631 }, 8632 "args": { 8633 "id": { 8634 "description": "Unique identifier for the term.", 8635 "type": "integer", 8636 "required": false 8637 }, 8638 "force": { 8639 "type": "boolean", 8640 "default": false, 8641 "description": "Required to be true, as terms do not support trashing.", 8642 "required": false 8643 } 8644 } 8645 } 8646 ] 8647 }, 8284 8648 "/wp/v2/users": { 8285 8649 "namespace": "wp/v2", … … 9453 9817 "category", 9454 9818 "post_tag", 9819 "wp_pattern_category", 9455 9820 "any" 9456 9821 ], … … 12027 12392 "slug": "wp_block", 12028 12393 "icon": null, 12029 "taxonomies": [], 12394 "taxonomies": [ 12395 "wp_pattern_category" 12396 ], 12030 12397 "rest_base": "blocks", 12031 12398 "rest_namespace": "wp/v2", … … 12332 12699 { 12333 12700 "href": "http://example.org/index.php?rest_route=/wp/v2/menus" 12701 } 12702 ], 12703 "curies": [ 12704 { 12705 "name": "wp", 12706 "href": "https://api.w.org/{rel}", 12707 "templated": true 12708 } 12709 ] 12710 } 12711 }, 12712 "wp_pattern_category": { 12713 "name": "Pattern Categories", 12714 "slug": "wp_pattern_category", 12715 "description": "", 12716 "types": [ 12717 "wp_block" 12718 ], 12719 "hierarchical": false, 12720 "rest_base": "wp_pattern_category", 12721 "rest_namespace": "wp/v2", 12722 "_links": { 12723 "collection": [ 12724 { 12725 "href": "http://example.org/index.php?rest_route=/wp/v2/taxonomies" 12726 } 12727 ], 12728 "wp:items": [ 12729 { 12730 "href": "http://example.org/index.php?rest_route=/wp/v2/wp_pattern_category" 12334 12731 } 12335 12732 ],
Note: See TracChangeset
for help on using the changeset viewer.