Changeset 56082
- Timestamp:
- 06/28/2023 03:33:23 AM (16 months ago)
- Location:
- trunk
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/package-lock.json
r56076 r56082 12729 12729 "version": "1.1.0", 12730 12730 "resolved": "https://registry.npmjs.org/from2-string/-/from2-string-1.1.0.tgz", 12731 "integrity": "sha 1-GCgrJ9CKJnyzAwzSuLSw8hKvdSo=",12731 "integrity": "sha512-m8vCh+KnXXXBtfF2VUbiYlQ+nczLcntB0BrtNgpmLkHylhObe9WF1b2LZjBBzrZzA6P4mkEla6ZYQoOUTG8cYA==", 12732 12732 "requires": { 12733 12733 "from2": "^2.0.3" … … 21800 21800 "version": "1.1.6", 21801 21801 "resolved": "https://registry.npmjs.org/promise-polyfill/-/promise-polyfill-1.1.6.tgz", 21802 "integrity": "sha 1-zQTv9G9clcOn0EVZHXm14+AfEtc="21802 "integrity": "sha512-7rrONfyLkDEc7OJ5QBkqa4KI4EBhCd340xRuIUPGCfu13znS+vx+VDdrT9ODAJHlXm7w4lbxN3DRjyv58EuzDg==" 21803 21803 }, 21804 21804 "prompts": { … … 23987 23987 "version": "1.0.0", 23988 23988 "resolved": "https://registry.npmjs.org/stream-from-promise/-/stream-from-promise-1.0.0.tgz", 23989 "integrity": "sha 1-djaH9913fkyJT2QIMz/Gs/yKYbs="23989 "integrity": "sha512-j84KLkudt+gr8KJ21RB02btPLx61uGbrLnewsWz6QKmsz8/c4ZFqXw6mJh5+G4oRN7DgDxdbjPxnpySpg1mUig==" 23990 23990 }, 23991 23991 "stream-to-string": { … … 25375 25375 "version": "2.0.2", 25376 25376 "resolved": "https://registry.npmjs.org/toposort/-/toposort-2.0.2.tgz", 25377 "integrity": "sha 1-riF2gXXRVZ1IvvNUILL0li8JwzA="25377 "integrity": "sha512-0a5EOkAUp8D4moMi2W8ZF8jcga7BgZd91O/yabJCFY8az+XSzeGyTKs0Aoo897iV1Nj6guFq8orWDS96z91oGg==" 25378 25378 }, 25379 25379 "totalist": { -
trunk/src/wp-includes/rest-api.php
r56052 r56082 316 316 // Block Types. 317 317 $controller = new WP_REST_Block_Types_Controller(); 318 $controller->register_routes(); 319 320 // Global Styles revisions. 321 $controller = new WP_REST_Global_Styles_Revisions_Controller(); 318 322 $controller->register_routes(); 319 323 -
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php
r55725 r56082 421 421 * 422 422 * @since 5.9.0 423 * @since 6.3.0 Adds revisions count and rest URL href to version-history. 423 424 * 424 425 * @param integer $id ID. … … 433 434 ), 434 435 ); 436 437 if ( post_type_supports( $this->post_type, 'revisions' ) ) { 438 $revisions = wp_get_latest_revision_id_and_total_count( $id ); 439 $revisions_count = ! is_wp_error( $revisions ) ? $revisions['count'] : 0; 440 $revisions_base = sprintf( '/%s/%d/revisions', $base, $id ); 441 $links['version-history'] = array( 442 'href' => rest_url( $revisions_base ), 443 'count' => $revisions_count, 444 ); 445 } 435 446 436 447 return $links; -
trunk/src/wp-settings.php
r56052 r56082 262 262 require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-attachments-controller.php'; 263 263 require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-global-styles-controller.php'; 264 require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-global-styles-revisions-controller.php'; 264 265 require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-post-types-controller.php'; 265 266 require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-post-statuses-controller.php'; -
trunk/tests/phpunit/tests/rest-api/rest-schema-setup.php
r55457 r56082 135 135 '/wp/v2/comments/(?P<id>[\\d]+)', 136 136 '/wp/v2/global-styles/(?P<id>[\/\w-]+)', 137 '/wp/v2/global-styles/(?P<parent>[\d]+)/revisions', 137 138 '/wp/v2/global-styles/themes/(?P<stylesheet>[\/\s%\w\.\(\)\[\]\@_\-]+)/variations', 138 139 '/wp/v2/global-styles/themes/(?P<stylesheet>[^\/:<>\*\?"\|]+(?:\/[^\/:<>\*\?"\|]+)?)', -
trunk/tests/qunit/fixtures/wp-api-generated.js
r56052 r56082 9619 9619 ] 9620 9620 }, 9621 "/wp/v2/global-styles/(?P<parent>[\\d]+)/revisions": { 9622 "namespace": "wp/v2", 9623 "methods": [ 9624 "GET" 9625 ], 9626 "endpoints": [ 9627 { 9628 "methods": [ 9629 "GET" 9630 ], 9631 "args": { 9632 "parent": { 9633 "description": "The ID for the parent of the revision.", 9634 "type": "integer", 9635 "required": false 9636 }, 9637 "context": { 9638 "description": "Scope under which the request is made; determines fields present in response.", 9639 "type": "string", 9640 "enum": [ 9641 "view", 9642 "embed", 9643 "edit" 9644 ], 9645 "default": "view", 9646 "required": false 9647 }, 9648 "page": { 9649 "description": "Current page of the collection.", 9650 "type": "integer", 9651 "default": 1, 9652 "minimum": 1, 9653 "required": false 9654 }, 9655 "per_page": { 9656 "description": "Maximum number of items to be returned in result set.", 9657 "type": "integer", 9658 "minimum": 1, 9659 "maximum": 100, 9660 "required": false 9661 }, 9662 "offset": { 9663 "description": "Offset the result set by a specific number of items.", 9664 "type": "integer", 9665 "required": false 9666 } 9667 } 9668 } 9669 ] 9670 }, 9621 9671 "/wp/v2/global-styles/themes/(?P<stylesheet>[\\/\\s%\\w\\.\\(\\)\\[\\]\\@_\\-]+)/variations": { 9622 9672 "namespace": "wp/v2",
Note: See TracChangeset
for help on using the changeset viewer.