Changeset 52079
- Timestamp:
- 11/09/2021 06:58:59 PM (3 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/nav-menu.php
r51301 r52079 407 407 * Save the properties of a menu item or create a new one. 408 408 * 409 * The menu-item-title, menu-item-description, and menu-item-attr-title are expected 410 * to be pre-slashed since they are passed directly into `wp_insert_post()`. 411 * 412 * @since 3.0.0 409 * The menu-item-title, menu-item-description, menu-item-attr-title, and menu-item-content are expected 410 * to be pre-slashed since they are passed directly to APIs that expect slashed data. 411 * 412 * @since 3.0.0 413 * @since 5.9.0 Added the menu-item-content parameter. 413 414 * 414 415 * @param int $menu_id The ID of the menu. Required. If "0", makes the menu item a draft orphan. … … 449 450 'menu-item-target' => '', 450 451 'menu-item-classes' => '', 452 'menu-item-content' => '', 451 453 'menu-item-xfn' => '', 452 454 'menu-item-status' => '', … … 527 529 $post['ID'] = 0; 528 530 $post['post_status'] = 'publish' === $args['menu-item-status'] ? 'publish' : 'draft'; 529 $menu_item_db_id = wp_insert_post( $post );531 $menu_item_db_id = wp_insert_post( $post, true ); 530 532 if ( ! $menu_item_db_id || is_wp_error( $menu_item_db_id ) ) { 531 533 return $menu_item_db_id; … … 549 551 // Only set the menu term if it isn't set to avoid unnecessary wp_get_object_terms(). 550 552 if ( $menu_id && ( ! $update || ! is_object_in_term( $menu_item_db_id, 'nav_menu', (int) $menu->term_id ) ) ) { 551 wp_set_object_terms( $menu_item_db_id, array( $menu->term_id ), 'nav_menu' ); 553 $update_terms = wp_set_object_terms( $menu_item_db_id, array( $menu->term_id ), 'nav_menu' ); 554 if ( is_wp_error( $update_terms ) ) { 555 return $update_terms; 556 } 552 557 } 553 558 … … 570 575 update_post_meta( $menu_item_db_id, '_menu_item_xfn', $args['menu-item-xfn'] ); 571 576 update_post_meta( $menu_item_db_id, '_menu_item_url', esc_url_raw( $args['menu-item-url'] ) ); 577 update_post_meta( $menu_item_db_id, '_menu_item_content', $args['menu-item-content'] ); 572 578 573 579 if ( 0 == $menu_id ) { … … 581 587 $post['ID'] = $menu_item_db_id; 582 588 $post['post_status'] = ( 'draft' === $args['menu-item-status'] ) ? 'draft' : 'publish'; 583 wp_update_post( $post ); 589 590 $update_post = wp_update_post( $post, true ); 591 if ( is_wp_error( $update_post ) ) { 592 return $update_post; 593 } 584 594 } 585 595 … … 904 914 $menu_item->title = ( '' === $menu_item->post_title ) ? $original_title : $menu_item->post_title; 905 915 916 } elseif ( 'block' === $menu_item->type ) { 917 $menu_item->type_label = __( 'Block' ); 918 $menu_item->title = $menu_item->post_title; 919 $menu_item->menu_item_content = ! isset( $menu_item->menu_item_content ) ? get_post_meta( $menu_item->ID, '_menu_item_content', true ) : $menu_item->menu_item_content; 906 920 } else { 907 921 $menu_item->type_label = __( 'Custom Link' ); -
trunk/src/wp-includes/post.php
r52069 r52079 127 127 'nav_menu_item', 128 128 array( 129 'labels' => array(129 'labels' => array( 130 130 'name' => __( 'Navigation Menu Items' ), 131 131 'singular_name' => __( 'Navigation Menu Item' ), 132 132 ), 133 'public' => false, 134 '_builtin' => true, /* internal use only. don't use this when registering your own post type. */ 135 'hierarchical' => false, 136 'rewrite' => false, 137 'delete_with_user' => false, 138 'query_var' => false, 133 'public' => false, 134 '_builtin' => true, /* internal use only. don't use this when registering your own post type. */ 135 'hierarchical' => false, 136 'rewrite' => false, 137 'delete_with_user' => false, 138 'query_var' => false, 139 'map_meta_cap' => true, 140 'capability_type' => array( 'edit_theme_options', 'edit_theme_options' ), 141 'capabilities' => array( 142 // Meta Capabilities. 143 'edit_post' => 'edit_post', 144 'read_post' => 'read_post', 145 'delete_post' => 'delete_post', 146 // Primitive Capabilities. 147 'edit_posts' => 'edit_theme_options', 148 'edit_others_posts' => 'edit_theme_options', 149 'delete_posts' => 'edit_theme_options', 150 'publish_posts' => 'edit_theme_options', 151 'read_private_posts' => 'edit_theme_options', 152 'read' => 'read', 153 'delete_private_posts' => 'edit_theme_options', 154 'delete_published_posts' => 'edit_theme_options', 155 'delete_others_posts' => 'edit_theme_options', 156 'edit_private_posts' => 'edit_theme_options', 157 'edit_published_posts' => 'edit_theme_options', 158 ), 159 'show_in_rest' => true, 160 'rest_base' => 'menu-items', 161 'rest_controller_class' => 'WP_REST_Menu_Items_Controller', 139 162 ) 140 163 ); -
trunk/src/wp-includes/rest-api.php
r52051 r52079 345 345 // URL Details. 346 346 $controller = new WP_REST_URL_Details_Controller(); 347 $controller->register_routes(); 348 349 // Menu Locations. 350 $controller = new WP_REST_Menu_Locations_Controller(); 347 351 $controller->register_routes(); 348 352 } -
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
r52068 r52079 1552 1552 } 1553 1553 1554 foreach ( $request[ $base ] as $term_id ) {1554 foreach ( (array) $request[ $base ] as $term_id ) { 1555 1555 // Invalid terms will be rejected later. 1556 1556 if ( ! get_term( $term_id, $taxonomy->name ) ) { -
trunk/src/wp-includes/taxonomy.php
r52062 r52079 109 109 'nav_menu_item', 110 110 array( 111 'public' => false,112 'hierarchical' => false,113 'labels' => array(111 'public' => false, 112 'hierarchical' => false, 113 'labels' => array( 114 114 'name' => __( 'Navigation Menus' ), 115 115 'singular_name' => __( 'Navigation Menu' ), 116 116 ), 117 'query_var' => false, 118 'rewrite' => false, 119 'show_ui' => false, 120 '_builtin' => true, 121 'show_in_nav_menus' => false, 117 'query_var' => false, 118 'rewrite' => false, 119 'show_ui' => false, 120 '_builtin' => true, 121 'show_in_nav_menus' => false, 122 'capabilities' => array( 123 'manage_terms' => 'edit_theme_options', 124 'edit_terms' => 'edit_theme_options', 125 'delete_terms' => 'edit_theme_options', 126 'assign_terms' => 'edit_theme_options', 127 ), 128 'show_in_rest' => true, 129 'rest_base' => 'menus', 130 'rest_controller_class' => 'WP_REST_Menus_Controller', 122 131 ) 123 132 ); -
trunk/src/wp-settings.php
r52069 r52079 263 263 require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-taxonomies-controller.php'; 264 264 require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-terms-controller.php'; 265 require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-menu-items-controller.php'; 266 require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-menus-controller.php'; 267 require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-menu-locations-controller.php'; 265 268 require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-users-controller.php'; 266 269 require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-comments-controller.php'; -
trunk/tests/phpunit/tests/rest-api/rest-schema-setup.php
r52069 r52079 90 90 '/wp/v2/posts/(?P<id>[\\d]+)/autosaves', 91 91 '/wp/v2/posts/(?P<parent>[\\d]+)/autosaves/(?P<id>[\\d]+)', 92 '/wp/v2/menu-items', 93 '/wp/v2/menu-items/(?P<id>[\d]+)', 94 '/wp/v2/menu-items/(?P<id>[\d]+)/autosaves', 95 '/wp/v2/menu-items/(?P<parent>[\d]+)/autosaves/(?P<id>[\d]+)', 96 '/wp/v2/menu-locations', 97 '/wp/v2/menu-locations/(?P<location>[\w-]+)', 98 '/wp/v2/menus', 99 '/wp/v2/menus/(?P<id>[\d]+)', 92 100 '/wp/v2/pages', 93 101 '/wp/v2/pages/(?P<id>[\\d]+)', -
trunk/tests/phpunit/tests/rest-api/rest-taxonomies-controller.php
r51964 r52079 69 69 $response = rest_get_server()->dispatch( $request ); 70 70 $data = $response->get_data(); 71 $taxonomies = $this->get_public_taxonomies( get_taxonomies( '', 'objects' ) ); 71 $taxonomies = get_taxonomies( '', 'objects' ); 72 unset( $taxonomies['nav_menu'] ); // Menus are not editable by contributors. 73 $taxonomies = $this->get_public_taxonomies( $taxonomies ); 72 74 $this->assertSame( count( $taxonomies ), count( $data ) ); 73 75 $this->assertSame( 'Categories', $data['category']['name'] ); -
trunk/tests/qunit/fixtures/wp-api-generated.js
r52070 r52079 3416 3416 ] 3417 3417 }, 3418 "/wp/v2/ blocks": {3418 "/wp/v2/menu-items": { 3419 3419 "namespace": "wp/v2", 3420 3420 "methods": [ … … 3452 3452 "description": "Maximum number of items to be returned in result set.", 3453 3453 "type": "integer", 3454 "default": 10 ,3454 "default": 100, 3455 3455 "minimum": 1, 3456 3456 "maximum": 100, … … 3512 3512 "description": "Order sort attribute ascending or descending.", 3513 3513 "type": "string", 3514 "default": " desc",3514 "default": "asc", 3515 3515 "enum": [ 3516 3516 "asc", … … 3520 3520 }, 3521 3521 "orderby": { 3522 "description": "Sort collection by post attribute.",3523 "type": "string", 3524 "default": " date",3522 "description": "Sort collection by object attribute.", 3523 "type": "string", 3524 "default": "menu_order", 3525 3525 "enum": [ 3526 3526 "author", … … 3533 3533 "slug", 3534 3534 "include_slugs", 3535 "title" 3535 "title", 3536 "menu_order" 3536 3537 ], 3537 3538 "required": false … … 3568 3569 }, 3569 3570 "required": false 3571 }, 3572 "tax_relation": { 3573 "description": "Limit result set based on relationship between multiple taxonomies.", 3574 "type": "string", 3575 "enum": [ 3576 "AND", 3577 "OR" 3578 ], 3579 "required": false 3580 }, 3581 "menus": { 3582 "description": "Limit result set to items with specific terms assigned in the menus taxonomy.", 3583 "type": [ 3584 "object", 3585 "array" 3586 ], 3587 "oneOf": [ 3588 { 3589 "title": "Term ID List", 3590 "description": "Match terms with the listed IDs.", 3591 "type": "array", 3592 "items": { 3593 "type": "integer" 3594 } 3595 }, 3596 { 3597 "title": "Term ID Taxonomy Query", 3598 "description": "Perform an advanced term query.", 3599 "type": "object", 3600 "properties": { 3601 "terms": { 3602 "description": "Term IDs.", 3603 "type": "array", 3604 "items": { 3605 "type": "integer" 3606 }, 3607 "default": [] 3608 }, 3609 "operator": { 3610 "description": "Whether items must be assigned all or any of the specified terms.", 3611 "type": "string", 3612 "enum": [ 3613 "AND", 3614 "OR" 3615 ], 3616 "default": "OR" 3617 } 3618 }, 3619 "additionalProperties": false 3620 } 3621 ], 3622 "required": false 3623 }, 3624 "menus_exclude": { 3625 "description": "Limit result set to items except those with specific terms assigned in the menus taxonomy.", 3626 "type": [ 3627 "object", 3628 "array" 3629 ], 3630 "oneOf": [ 3631 { 3632 "title": "Term ID List", 3633 "description": "Match terms with the listed IDs.", 3634 "type": "array", 3635 "items": { 3636 "type": "integer" 3637 } 3638 }, 3639 { 3640 "title": "Term ID Taxonomy Query", 3641 "description": "Perform an advanced term query.", 3642 "type": "object", 3643 "properties": { 3644 "terms": { 3645 "description": "Term IDs.", 3646 "type": "array", 3647 "items": { 3648 "type": "integer" 3649 }, 3650 "default": [] 3651 } 3652 }, 3653 "additionalProperties": false 3654 } 3655 ], 3656 "required": false 3657 }, 3658 "menu_order": { 3659 "description": "Limit result set to posts with a specific menu_order value.", 3660 "type": "integer", 3661 "required": false 3570 3662 } 3571 3663 } … … 3579 3671 }, 3580 3672 "args": { 3581 " date": {3582 "description": "The date the post was published, in the site's timezone.",3673 "title": { 3674 "description": "The title for the object.", 3583 3675 "type": [ 3584 3676 "string", 3585 "null" 3586 ], 3587 "format": "date-time", 3588 "required": false 3589 }, 3590 "date_gmt": { 3591 "description": "The date the post was published, as GMT.", 3592 "type": [ 3593 "string", 3594 "null" 3595 ], 3596 "format": "date-time", 3597 "required": false 3598 }, 3599 "slug": { 3600 "description": "An alphanumeric identifier for the post unique to its type.", 3601 "type": "string", 3602 "required": false 3603 }, 3604 "status": { 3605 "description": "A named status for the post.", 3606 "type": "string", 3607 "enum": [ 3608 "publish", 3609 "future", 3610 "draft", 3611 "pending", 3612 "private" 3613 ], 3614 "required": false 3615 }, 3616 "password": { 3617 "description": "A password to protect access to the content and excerpt.", 3618 "type": "string", 3619 "required": false 3620 }, 3621 "title": { 3622 "description": "The title for the post.", 3623 "type": "object", 3677 "object" 3678 ], 3624 3679 "properties": { 3625 3680 "raw": { 3626 "description": "Title for the post, as it exists in the database.",3681 "description": "Title for the object, as it exists in the database.", 3627 3682 "type": "string", 3628 3683 "context": [ 3629 "view",3630 "edit"3631 ]3632 }3633 },3634 "required": false3635 },3636 "content": {3637 "description": "The content for the post.",3638 "type": "object",3639 "properties": {3640 "raw": {3641 "description": "Content for the post, as it exists in the database.",3642 "type": "string",3643 "context": [3644 "view",3645 3684 "edit" 3646 3685 ] 3647 3686 }, 3648 "block_version": { 3649 "description": "Version of the content block format used by the post.", 3650 "type": "integer", 3651 "context": [ 3652 "edit" 3653 ], 3654 "readonly": true 3655 }, 3656 "protected": { 3657 "description": "Whether the content is protected with a password.", 3658 "type": "boolean", 3687 "rendered": { 3688 "description": "HTML title for the object, transformed for display.", 3689 "type": "string", 3659 3690 "context": [ 3660 3691 "view", … … 3667 3698 "required": false 3668 3699 }, 3669 "template": { 3670 "description": "The theme file to use to display the post.", 3671 "type": "string", 3700 "type": { 3701 "default": "custom", 3702 "description": "The family of objects originally represented, such as \"post_type\" or \"taxonomy\".", 3703 "type": "string", 3704 "enum": [ 3705 "taxonomy", 3706 "post_type", 3707 "post_type_archive", 3708 "custom", 3709 "block" 3710 ], 3711 "required": false 3712 }, 3713 "status": { 3714 "default": "publish", 3715 "description": "A named status for the object.", 3716 "type": "string", 3717 "enum": [ 3718 "publish", 3719 "future", 3720 "draft", 3721 "pending", 3722 "private" 3723 ], 3724 "required": false 3725 }, 3726 "parent": { 3727 "default": 0, 3728 "description": "The ID for the parent of the object.", 3729 "type": "integer", 3730 "minimum": 0, 3731 "required": false 3732 }, 3733 "attr_title": { 3734 "description": "Text for the title attribute of the link element for this menu item.", 3735 "type": "string", 3736 "required": false 3737 }, 3738 "classes": { 3739 "description": "Class names for the link element of this menu item.", 3740 "type": "array", 3741 "items": { 3742 "type": "string" 3743 }, 3744 "required": false 3745 }, 3746 "description": { 3747 "description": "The description of this menu item.", 3748 "type": "string", 3749 "required": false 3750 }, 3751 "menu_order": { 3752 "default": 1, 3753 "description": "The DB ID of the nav_menu_item that is this item's menu parent, if any, otherwise 0.", 3754 "type": "integer", 3755 "minimum": 1, 3756 "required": false 3757 }, 3758 "object": { 3759 "description": "The type of object originally represented, such as \"category,\" \"post\", or \"attachment.\"", 3760 "type": "string", 3761 "required": false 3762 }, 3763 "object_id": { 3764 "default": 0, 3765 "description": "The database ID of the original object this menu item represents, for example the ID for posts or the term_id for categories.", 3766 "type": "integer", 3767 "minimum": 0, 3768 "required": false 3769 }, 3770 "content": { 3771 "description": "HTML content to display for this block menu item.", 3772 "type": [ 3773 "string", 3774 "object" 3775 ], 3776 "properties": { 3777 "raw": { 3778 "description": "HTML content, as it exists in the database.", 3779 "type": "string", 3780 "context": [ 3781 "edit" 3782 ] 3783 }, 3784 "rendered": { 3785 "description": "HTML content, transformed for display.", 3786 "type": "string", 3787 "context": [ 3788 "view", 3789 "edit" 3790 ], 3791 "readonly": true 3792 }, 3793 "block_version": { 3794 "description": "Version of the block format used in the HTML content.", 3795 "type": "integer", 3796 "context": [ 3797 "edit" 3798 ], 3799 "readonly": true 3800 } 3801 }, 3802 "required": false 3803 }, 3804 "target": { 3805 "description": "The target attribute of the link element for this menu item.", 3806 "type": "string", 3807 "enum": [ 3808 "_blank", 3809 "" 3810 ], 3811 "required": false 3812 }, 3813 "url": { 3814 "description": "The URL to which this menu item points.", 3815 "type": "string", 3816 "format": "uri", 3817 "required": false 3818 }, 3819 "xfn": { 3820 "description": "The XFN relationship expressed in the link of this menu item.", 3821 "type": "array", 3822 "items": { 3823 "type": "string" 3824 }, 3825 "required": false 3826 }, 3827 "menus": { 3828 "description": "The terms assigned to the object in the nav_menu taxonomy.", 3829 "type": "integer", 3830 "required": false 3831 }, 3832 "meta": { 3833 "description": "Meta fields.", 3834 "type": "object", 3835 "properties": [], 3672 3836 "required": false 3673 3837 } … … 3676 3840 ], 3677 3841 "_links": { 3678 "self": "http://example.org/index.php?rest_route=/wp/v2/blocks" 3842 "self": [ 3843 { 3844 "href": "http://example.org/index.php?rest_route=/wp/v2/menu-items" 3845 } 3846 ] 3679 3847 } 3680 3848 }, 3681 "/wp/v2/ blocks/(?P<id>[\\d]+)": {3849 "/wp/v2/menu-items/(?P<id>[\\d]+)": { 3682 3850 "namespace": "wp/v2", 3683 3851 "methods": [ … … 3712 3880 "default": "view", 3713 3881 "required": false 3714 },3715 "password": {3716 "description": "The password for the post if it is password protected.",3717 "type": "string",3718 "required": false3719 3882 } 3720 3883 } … … 3735 3898 "required": false 3736 3899 }, 3737 " date": {3738 "description": "The date the post was published, in the site's timezone.",3900 "title": { 3901 "description": "The title for the object.", 3739 3902 "type": [ 3740 3903 "string", 3741 "null" 3742 ], 3743 "format": "date-time", 3744 "required": false 3745 }, 3746 "date_gmt": { 3747 "description": "The date the post was published, as GMT.", 3748 "type": [ 3749 "string", 3750 "null" 3751 ], 3752 "format": "date-time", 3753 "required": false 3754 }, 3755 "slug": { 3756 "description": "An alphanumeric identifier for the post unique to its type.", 3757 "type": "string", 3758 "required": false 3759 }, 3760 "status": { 3761 "description": "A named status for the post.", 3762 "type": "string", 3763 "enum": [ 3764 "publish", 3765 "future", 3766 "draft", 3767 "pending", 3768 "private" 3769 ], 3770 "required": false 3771 }, 3772 "password": { 3773 "description": "A password to protect access to the content and excerpt.", 3774 "type": "string", 3775 "required": false 3776 }, 3777 "title": { 3778 "description": "The title for the post.", 3779 "type": "object", 3904 "object" 3905 ], 3780 3906 "properties": { 3781 3907 "raw": { 3782 "description": "Title for the post, as it exists in the database.",3908 "description": "Title for the object, as it exists in the database.", 3783 3909 "type": "string", 3784 3910 "context": [ 3785 "view",3786 "edit"3787 ]3788 }3789 },3790 "required": false3791 },3792 "content": {3793 "description": "The content for the post.",3794 "type": "object",3795 "properties": {3796 "raw": {3797 "description": "Content for the post, as it exists in the database.",3798 "type": "string",3799 "context": [3800 "view",3801 3911 "edit" 3802 3912 ] 3803 3913 }, 3804 "block_version": { 3805 "description": "Version of the content block format used by the post.", 3806 "type": "integer", 3807 "context": [ 3808 "edit" 3809 ], 3810 "readonly": true 3811 }, 3812 "protected": { 3813 "description": "Whether the content is protected with a password.", 3814 "type": "boolean", 3914 "rendered": { 3915 "description": "HTML title for the object, transformed for display.", 3916 "type": "string", 3815 3917 "context": [ 3816 3918 "view", … … 3823 3925 "required": false 3824 3926 }, 3825 "template": { 3826 "description": "The theme file to use to display the post.", 3827 "type": "string", 3828 "required": false 3829 } 3830 } 3831 }, 3832 { 3833 "methods": [ 3834 "DELETE" 3835 ], 3836 "allow_batch": { 3837 "v1": true 3838 }, 3839 "args": { 3840 "id": { 3841 "description": "Unique identifier for the post.", 3842 "type": "integer", 3843 "required": false 3844 }, 3845 "force": { 3846 "type": "boolean", 3847 "default": false, 3848 "description": "Whether to bypass Trash and force deletion.", 3849 "required": false 3850 } 3851 } 3852 } 3853 ] 3854 }, 3855 "/wp/v2/blocks/(?P<parent>[\\d]+)/revisions": { 3856 "namespace": "wp/v2", 3857 "methods": [ 3858 "GET" 3859 ], 3860 "endpoints": [ 3861 { 3862 "methods": [ 3863 "GET" 3864 ], 3865 "args": { 3866 "parent": { 3867 "description": "The ID for the parent of the revision.", 3868 "type": "integer", 3869 "required": false 3870 }, 3871 "context": { 3872 "description": "Scope under which the request is made; determines fields present in response.", 3873 "type": "string", 3874 "enum": [ 3875 "view", 3876 "embed", 3877 "edit" 3878 ], 3879 "default": "view", 3880 "required": false 3881 }, 3882 "page": { 3883 "description": "Current page of the collection.", 3884 "type": "integer", 3885 "default": 1, 3886 "minimum": 1, 3887 "required": false 3888 }, 3889 "per_page": { 3890 "description": "Maximum number of items to be returned in result set.", 3891 "type": "integer", 3892 "minimum": 1, 3893 "maximum": 100, 3894 "required": false 3895 }, 3896 "search": { 3897 "description": "Limit results to those matching a string.", 3898 "type": "string", 3899 "required": false 3900 }, 3901 "exclude": { 3902 "description": "Ensure result set excludes specific IDs.", 3903 "type": "array", 3904 "items": { 3905 "type": "integer" 3906 }, 3907 "default": [], 3908 "required": false 3909 }, 3910 "include": { 3911 "description": "Limit result set to specific IDs.", 3912 "type": "array", 3913 "items": { 3914 "type": "integer" 3915 }, 3916 "default": [], 3917 "required": false 3918 }, 3919 "offset": { 3920 "description": "Offset the result set by a specific number of items.", 3921 "type": "integer", 3922 "required": false 3923 }, 3924 "order": { 3925 "description": "Order sort attribute ascending or descending.", 3926 "type": "string", 3927 "default": "desc", 3928 "enum": [ 3929 "asc", 3930 "desc" 3931 ], 3932 "required": false 3933 }, 3934 "orderby": { 3935 "description": "Sort collection by object attribute.", 3936 "type": "string", 3937 "default": "date", 3938 "enum": [ 3939 "date", 3940 "id", 3941 "include", 3942 "relevance", 3943 "slug", 3944 "include_slugs", 3945 "title" 3946 ], 3947 "required": false 3948 } 3949 } 3950 } 3951 ] 3952 }, 3953 "/wp/v2/blocks/(?P<parent>[\\d]+)/revisions/(?P<id>[\\d]+)": { 3954 "namespace": "wp/v2", 3955 "methods": [ 3956 "GET", 3957 "DELETE" 3958 ], 3959 "endpoints": [ 3960 { 3961 "methods": [ 3962 "GET" 3963 ], 3964 "args": { 3965 "parent": { 3966 "description": "The ID for the parent of the revision.", 3967 "type": "integer", 3968 "required": false 3969 }, 3970 "id": { 3971 "description": "Unique identifier for the revision.", 3972 "type": "integer", 3973 "required": false 3974 }, 3975 "context": { 3976 "description": "Scope under which the request is made; determines fields present in response.", 3977 "type": "string", 3978 "enum": [ 3979 "view", 3980 "embed", 3981 "edit" 3982 ], 3983 "default": "view", 3984 "required": false 3985 } 3986 } 3987 }, 3988 { 3989 "methods": [ 3990 "DELETE" 3991 ], 3992 "args": { 3993 "parent": { 3994 "description": "The ID for the parent of the revision.", 3995 "type": "integer", 3996 "required": false 3997 }, 3998 "id": { 3999 "description": "Unique identifier for the revision.", 4000 "type": "integer", 4001 "required": false 4002 }, 4003 "force": { 4004 "type": "boolean", 4005 "default": false, 4006 "description": "Required to be true, as revisions do not support trashing.", 4007 "required": false 4008 } 4009 } 4010 } 4011 ] 4012 }, 4013 "/wp/v2/blocks/(?P<id>[\\d]+)/autosaves": { 4014 "namespace": "wp/v2", 4015 "methods": [ 4016 "GET", 4017 "POST" 4018 ], 4019 "endpoints": [ 4020 { 4021 "methods": [ 4022 "GET" 4023 ], 4024 "args": { 4025 "parent": { 4026 "description": "The ID for the parent of the autosave.", 4027 "type": "integer", 4028 "required": false 4029 }, 4030 "context": { 4031 "description": "Scope under which the request is made; determines fields present in response.", 4032 "type": "string", 4033 "enum": [ 4034 "view", 4035 "embed", 4036 "edit" 4037 ], 4038 "default": "view", 4039 "required": false 4040 } 4041 } 4042 }, 4043 { 4044 "methods": [ 4045 "POST" 4046 ], 4047 "args": { 4048 "parent": { 4049 "description": "The ID for the parent of the autosave.", 4050 "type": "integer", 4051 "required": false 4052 }, 4053 "date": { 4054 "description": "The date the post was published, in the site's timezone.", 4055 "type": [ 4056 "string", 4057 "null" 4058 ], 4059 "format": "date-time", 4060 "required": false 4061 }, 4062 "date_gmt": { 4063 "description": "The date the post was published, as GMT.", 4064 "type": [ 4065 "string", 4066 "null" 4067 ], 4068 "format": "date-time", 4069 "required": false 4070 }, 4071 "slug": { 4072 "description": "An alphanumeric identifier for the post unique to its type.", 4073 "type": "string", 3927 "type": { 3928 "description": "The family of objects originally represented, such as \"post_type\" or \"taxonomy\".", 3929 "type": "string", 3930 "enum": [ 3931 "taxonomy", 3932 "post_type", 3933 "post_type_archive", 3934 "custom", 3935 "block" 3936 ], 4074 3937 "required": false 4075 3938 }, 4076 3939 "status": { 4077 "description": "A named status for the post.",3940 "description": "A named status for the object.", 4078 3941 "type": "string", 4079 3942 "enum": [ … … 4086 3949 "required": false 4087 3950 }, 4088 "password": { 4089 "description": "A password to protect access to the content and excerpt.", 4090 "type": "string", 4091 "required": false 4092 }, 4093 "title": { 4094 "description": "The title for the post.", 4095 "type": "object", 3951 "parent": { 3952 "description": "The ID for the parent of the object.", 3953 "type": "integer", 3954 "minimum": 0, 3955 "required": false 3956 }, 3957 "attr_title": { 3958 "description": "Text for the title attribute of the link element for this menu item.", 3959 "type": "string", 3960 "required": false 3961 }, 3962 "classes": { 3963 "description": "Class names for the link element of this menu item.", 3964 "type": "array", 3965 "items": { 3966 "type": "string" 3967 }, 3968 "required": false 3969 }, 3970 "description": { 3971 "description": "The description of this menu item.", 3972 "type": "string", 3973 "required": false 3974 }, 3975 "menu_order": { 3976 "description": "The DB ID of the nav_menu_item that is this item's menu parent, if any, otherwise 0.", 3977 "type": "integer", 3978 "minimum": 1, 3979 "required": false 3980 }, 3981 "object": { 3982 "description": "The type of object originally represented, such as \"category,\" \"post\", or \"attachment.\"", 3983 "type": "string", 3984 "required": false 3985 }, 3986 "object_id": { 3987 "description": "The database ID of the original object this menu item represents, for example the ID for posts or the term_id for categories.", 3988 "type": "integer", 3989 "minimum": 0, 3990 "required": false 3991 }, 3992 "content": { 3993 "description": "HTML content to display for this block menu item.", 3994 "type": [ 3995 "string", 3996 "object" 3997 ], 4096 3998 "properties": { 4097 3999 "raw": { 4098 "description": " Title for the post, as it exists in the database.",4000 "description": "HTML content, as it exists in the database.", 4099 4001 "type": "string", 4100 4002 "context": [ 4101 "view",4102 "edit"4103 ]4104 }4105 },4106 "required": false4107 },4108 "content": {4109 "description": "The content for the post.",4110 "type": "object",4111 "properties": {4112 "raw": {4113 "description": "Content for the post, as it exists in the database.",4114 "type": "string",4115 "context": [4116 "view",4117 4003 "edit" 4118 4004 ] 4119 4005 }, 4120 "block_version": { 4121 "description": "Version of the content block format used by the post.", 4122 "type": "integer", 4123 "context": [ 4006 "rendered": { 4007 "description": "HTML content, transformed for display.", 4008 "type": "string", 4009 "context": [ 4010 "view", 4124 4011 "edit" 4125 4012 ], 4126 4013 "readonly": true 4127 4014 }, 4128 "protected": { 4129 "description": "Whether the content is protected with a password.", 4130 "type": "boolean", 4015 "block_version": { 4016 "description": "Version of the block format used in the HTML content.", 4017 "type": "integer", 4018 "context": [ 4019 "edit" 4020 ], 4021 "readonly": true 4022 } 4023 }, 4024 "required": false 4025 }, 4026 "target": { 4027 "description": "The target attribute of the link element for this menu item.", 4028 "type": "string", 4029 "enum": [ 4030 "_blank", 4031 "" 4032 ], 4033 "required": false 4034 }, 4035 "url": { 4036 "description": "The URL to which this menu item points.", 4037 "type": "string", 4038 "format": "uri", 4039 "required": false 4040 }, 4041 "xfn": { 4042 "description": "The XFN relationship expressed in the link of this menu item.", 4043 "type": "array", 4044 "items": { 4045 "type": "string" 4046 }, 4047 "required": false 4048 }, 4049 "menus": { 4050 "description": "The terms assigned to the object in the nav_menu taxonomy.", 4051 "type": "integer", 4052 "required": false 4053 }, 4054 "meta": { 4055 "description": "Meta fields.", 4056 "type": "object", 4057 "properties": [], 4058 "required": false 4059 } 4060 } 4061 }, 4062 { 4063 "methods": [ 4064 "DELETE" 4065 ], 4066 "allow_batch": { 4067 "v1": true 4068 }, 4069 "args": { 4070 "id": { 4071 "description": "Unique identifier for the post.", 4072 "type": "integer", 4073 "required": false 4074 }, 4075 "force": { 4076 "type": "boolean", 4077 "default": false, 4078 "description": "Whether to bypass Trash and force deletion.", 4079 "required": false 4080 } 4081 } 4082 } 4083 ] 4084 }, 4085 "/wp/v2/menu-items/(?P<id>[\\d]+)/autosaves": { 4086 "namespace": "wp/v2", 4087 "methods": [ 4088 "GET", 4089 "POST" 4090 ], 4091 "endpoints": [ 4092 { 4093 "methods": [ 4094 "GET" 4095 ], 4096 "args": { 4097 "parent": { 4098 "description": "The ID for the parent of the autosave.", 4099 "type": "integer", 4100 "required": false 4101 }, 4102 "context": { 4103 "description": "Scope under which the request is made; determines fields present in response.", 4104 "type": "string", 4105 "enum": [ 4106 "view", 4107 "embed", 4108 "edit" 4109 ], 4110 "default": "view", 4111 "required": false 4112 } 4113 } 4114 }, 4115 { 4116 "methods": [ 4117 "POST" 4118 ], 4119 "args": { 4120 "parent": { 4121 "description": "The ID for the parent of the object.", 4122 "type": "integer", 4123 "minimum": 0, 4124 "required": false 4125 }, 4126 "title": { 4127 "description": "The title for the object.", 4128 "type": [ 4129 "string", 4130 "object" 4131 ], 4132 "properties": { 4133 "raw": { 4134 "description": "Title for the object, as it exists in the database.", 4135 "type": "string", 4136 "context": [ 4137 "edit" 4138 ] 4139 }, 4140 "rendered": { 4141 "description": "HTML title for the object, transformed for display.", 4142 "type": "string", 4131 4143 "context": [ 4132 4144 "view", … … 4139 4151 "required": false 4140 4152 }, 4141 "template": { 4142 "description": "The theme file to use to display the post.", 4143 "type": "string", 4153 "type": { 4154 "description": "The family of objects originally represented, such as \"post_type\" or \"taxonomy\".", 4155 "type": "string", 4156 "enum": [ 4157 "taxonomy", 4158 "post_type", 4159 "post_type_archive", 4160 "custom", 4161 "block" 4162 ], 4163 "required": false 4164 }, 4165 "status": { 4166 "description": "A named status for the object.", 4167 "type": "string", 4168 "enum": [ 4169 "publish", 4170 "future", 4171 "draft", 4172 "pending", 4173 "private" 4174 ], 4175 "required": false 4176 }, 4177 "attr_title": { 4178 "description": "Text for the title attribute of the link element for this menu item.", 4179 "type": "string", 4180 "required": false 4181 }, 4182 "classes": { 4183 "description": "Class names for the link element of this menu item.", 4184 "type": "array", 4185 "items": { 4186 "type": "string" 4187 }, 4188 "required": false 4189 }, 4190 "description": { 4191 "description": "The description of this menu item.", 4192 "type": "string", 4193 "required": false 4194 }, 4195 "menu_order": { 4196 "description": "The DB ID of the nav_menu_item that is this item's menu parent, if any, otherwise 0.", 4197 "type": "integer", 4198 "minimum": 1, 4199 "required": false 4200 }, 4201 "object": { 4202 "description": "The type of object originally represented, such as \"category,\" \"post\", or \"attachment.\"", 4203 "type": "string", 4204 "required": false 4205 }, 4206 "object_id": { 4207 "description": "The database ID of the original object this menu item represents, for example the ID for posts or the term_id for categories.", 4208 "type": "integer", 4209 "minimum": 0, 4210 "required": false 4211 }, 4212 "content": { 4213 "description": "HTML content to display for this block menu item.", 4214 "type": [ 4215 "string", 4216 "object" 4217 ], 4218 "properties": { 4219 "raw": { 4220 "description": "HTML content, as it exists in the database.", 4221 "type": "string", 4222 "context": [ 4223 "edit" 4224 ] 4225 }, 4226 "rendered": { 4227 "description": "HTML content, transformed for display.", 4228 "type": "string", 4229 "context": [ 4230 "view", 4231 "edit" 4232 ], 4233 "readonly": true 4234 }, 4235 "block_version": { 4236 "description": "Version of the block format used in the HTML content.", 4237 "type": "integer", 4238 "context": [ 4239 "edit" 4240 ], 4241 "readonly": true 4242 } 4243 }, 4244 "required": false 4245 }, 4246 "target": { 4247 "description": "The target attribute of the link element for this menu item.", 4248 "type": "string", 4249 "enum": [ 4250 "_blank", 4251 "" 4252 ], 4253 "required": false 4254 }, 4255 "url": { 4256 "description": "The URL to which this menu item points.", 4257 "type": "string", 4258 "format": "uri", 4259 "required": false 4260 }, 4261 "xfn": { 4262 "description": "The XFN relationship expressed in the link of this menu item.", 4263 "type": "array", 4264 "items": { 4265 "type": "string" 4266 }, 4267 "required": false 4268 }, 4269 "menus": { 4270 "description": "The terms assigned to the object in the nav_menu taxonomy.", 4271 "type": "integer", 4272 "required": false 4273 }, 4274 "meta": { 4275 "description": "Meta fields.", 4276 "type": "object", 4277 "properties": [], 4144 4278 "required": false 4145 4279 } … … 4148 4282 ] 4149 4283 }, 4150 "/wp/v2/ blocks/(?P<parent>[\\d]+)/autosaves/(?P<id>[\\d]+)": {4284 "/wp/v2/menu-items/(?P<parent>[\\d]+)/autosaves/(?P<id>[\\d]+)": { 4151 4285 "namespace": "wp/v2", 4152 4286 "methods": [ … … 4184 4318 ] 4185 4319 }, 4186 "/wp/v2/templates": { 4187 "namespace": "wp/v2", 4188 "methods": [ 4189 "GET", 4190 "POST" 4191 ], 4192 "endpoints": [ 4193 { 4194 "methods": [ 4195 "GET" 4196 ], 4197 "args": { 4198 "context": { 4199 "description": "Scope under which the request is made; determines fields present in response.", 4200 "type": "string", 4201 "enum": [ 4202 "view", 4203 "embed", 4204 "edit" 4205 ], 4206 "required": false 4207 }, 4208 "wp_id": { 4209 "description": "Limit to the specified post id.", 4210 "type": "integer", 4211 "required": false 4212 }, 4213 "area": { 4214 "description": "Limit to the specified template part area.", 4215 "type": "string", 4216 "required": false 4217 }, 4218 "post_type": { 4219 "description": "Post type to get the templates for.", 4220 "type": "string", 4221 "required": false 4222 } 4223 } 4224 }, 4225 { 4226 "methods": [ 4227 "POST" 4228 ], 4229 "args": { 4230 "slug": { 4231 "description": "Unique slug identifying the template.", 4232 "type": "string", 4233 "minLength": 1, 4234 "pattern": "[a-zA-Z_\\-]+", 4235 "required": true 4236 }, 4237 "theme": { 4238 "description": "Theme identifier for the template.", 4239 "type": "string", 4240 "required": false 4241 }, 4242 "content": { 4243 "default": "", 4244 "description": "Content of template.", 4245 "type": [ 4246 "object", 4247 "string" 4248 ], 4249 "required": false 4250 }, 4251 "title": { 4252 "default": "", 4253 "description": "Title of template.", 4254 "type": [ 4255 "object", 4256 "string" 4257 ], 4258 "required": false 4259 }, 4260 "description": { 4261 "default": "", 4262 "description": "Description of template.", 4263 "type": "string", 4264 "required": false 4265 }, 4266 "status": { 4267 "default": "publish", 4268 "description": "Status of template.", 4269 "type": "string", 4270 "required": false 4271 } 4272 } 4273 } 4274 ], 4275 "_links": { 4276 "self": [ 4277 { 4278 "href": "http://example.org/index.php?rest_route=/wp/v2/templates" 4279 } 4280 ] 4281 } 4282 }, 4283 "/wp/v2/templates/(?P<id>[\\/\\w-]+)": { 4284 "namespace": "wp/v2", 4285 "methods": [ 4286 "GET", 4287 "POST", 4288 "PUT", 4289 "PATCH", 4290 "DELETE" 4291 ], 4292 "endpoints": [ 4293 { 4294 "methods": [ 4295 "GET" 4296 ], 4297 "args": { 4298 "id": { 4299 "description": "The id of a template", 4300 "type": "string", 4301 "required": false 4302 } 4303 } 4304 }, 4305 { 4306 "methods": [ 4307 "POST", 4308 "PUT", 4309 "PATCH" 4310 ], 4311 "args": { 4312 "slug": { 4313 "description": "Unique slug identifying the template.", 4314 "type": "string", 4315 "minLength": 1, 4316 "pattern": "[a-zA-Z_\\-]+", 4317 "required": false 4318 }, 4319 "theme": { 4320 "description": "Theme identifier for the template.", 4321 "type": "string", 4322 "required": false 4323 }, 4324 "content": { 4325 "description": "Content of template.", 4326 "type": [ 4327 "object", 4328 "string" 4329 ], 4330 "required": false 4331 }, 4332 "title": { 4333 "description": "Title of template.", 4334 "type": [ 4335 "object", 4336 "string" 4337 ], 4338 "required": false 4339 }, 4340 "description": { 4341 "description": "Description of template.", 4342 "type": "string", 4343 "required": false 4344 }, 4345 "status": { 4346 "description": "Status of template.", 4347 "type": "string", 4348 "required": false 4349 } 4350 } 4351 }, 4352 { 4353 "methods": [ 4354 "DELETE" 4355 ], 4356 "args": { 4357 "force": { 4358 "type": "boolean", 4359 "default": false, 4360 "description": "Whether to bypass Trash and force deletion.", 4361 "required": false 4362 } 4363 } 4364 } 4365 ] 4366 }, 4367 "/wp/v2/templates/(?P<parent>[\\d]+)/revisions": { 4368 "namespace": "wp/v2", 4369 "methods": [ 4370 "GET" 4371 ], 4372 "endpoints": [ 4373 { 4374 "methods": [ 4375 "GET" 4376 ], 4377 "args": { 4378 "parent": { 4379 "description": "The ID for the parent of the revision.", 4380 "type": "integer", 4381 "required": false 4382 }, 4383 "context": { 4384 "description": "Scope under which the request is made; determines fields present in response.", 4385 "type": "string", 4386 "enum": [ 4387 "view", 4388 "embed", 4389 "edit" 4390 ], 4391 "default": "view", 4392 "required": false 4393 }, 4394 "page": { 4395 "description": "Current page of the collection.", 4396 "type": "integer", 4397 "default": 1, 4398 "minimum": 1, 4399 "required": false 4400 }, 4401 "per_page": { 4402 "description": "Maximum number of items to be returned in result set.", 4403 "type": "integer", 4404 "minimum": 1, 4405 "maximum": 100, 4406 "required": false 4407 }, 4408 "search": { 4409 "description": "Limit results to those matching a string.", 4410 "type": "string", 4411 "required": false 4412 }, 4413 "exclude": { 4414 "description": "Ensure result set excludes specific IDs.", 4415 "type": "array", 4416 "items": { 4417 "type": "integer" 4418 }, 4419 "default": [], 4420 "required": false 4421 }, 4422 "include": { 4423 "description": "Limit result set to specific IDs.", 4424 "type": "array", 4425 "items": { 4426 "type": "integer" 4427 }, 4428 "default": [], 4429 "required": false 4430 }, 4431 "offset": { 4432 "description": "Offset the result set by a specific number of items.", 4433 "type": "integer", 4434 "required": false 4435 }, 4436 "order": { 4437 "description": "Order sort attribute ascending or descending.", 4438 "type": "string", 4439 "default": "desc", 4440 "enum": [ 4441 "asc", 4442 "desc" 4443 ], 4444 "required": false 4445 }, 4446 "orderby": { 4447 "description": "Sort collection by object attribute.", 4448 "type": "string", 4449 "default": "date", 4450 "enum": [ 4451 "date", 4452 "id", 4453 "include", 4454 "relevance", 4455 "slug", 4456 "include_slugs", 4457 "title" 4458 ], 4459 "required": false 4460 } 4461 } 4462 } 4463 ] 4464 }, 4465 "/wp/v2/templates/(?P<parent>[\\d]+)/revisions/(?P<id>[\\d]+)": { 4466 "namespace": "wp/v2", 4467 "methods": [ 4468 "GET", 4469 "DELETE" 4470 ], 4471 "endpoints": [ 4472 { 4473 "methods": [ 4474 "GET" 4475 ], 4476 "args": { 4477 "parent": { 4478 "description": "The ID for the parent of the revision.", 4479 "type": "integer", 4480 "required": false 4481 }, 4482 "id": { 4483 "description": "Unique identifier for the revision.", 4484 "type": "integer", 4485 "required": false 4486 }, 4487 "context": { 4488 "description": "Scope under which the request is made; determines fields present in response.", 4489 "type": "string", 4490 "enum": [ 4491 "view", 4492 "embed", 4493 "edit" 4494 ], 4495 "default": "view", 4496 "required": false 4497 } 4498 } 4499 }, 4500 { 4501 "methods": [ 4502 "DELETE" 4503 ], 4504 "args": { 4505 "parent": { 4506 "description": "The ID for the parent of the revision.", 4507 "type": "integer", 4508 "required": false 4509 }, 4510 "id": { 4511 "description": "Unique identifier for the revision.", 4512 "type": "integer", 4513 "required": false 4514 }, 4515 "force": { 4516 "type": "boolean", 4517 "default": false, 4518 "description": "Required to be true, as revisions do not support trashing.", 4519 "required": false 4520 } 4521 } 4522 } 4523 ] 4524 }, 4525 "/wp/v2/templates/(?P<id>[\\d]+)/autosaves": { 4526 "namespace": "wp/v2", 4527 "methods": [ 4528 "GET", 4529 "POST" 4530 ], 4531 "endpoints": [ 4532 { 4533 "methods": [ 4534 "GET" 4535 ], 4536 "args": { 4537 "parent": { 4538 "description": "The ID for the parent of the autosave.", 4539 "type": "integer", 4540 "required": false 4541 }, 4542 "context": { 4543 "description": "Scope under which the request is made; determines fields present in response.", 4544 "type": "string", 4545 "enum": [ 4546 "view", 4547 "embed", 4548 "edit" 4549 ], 4550 "default": "view", 4551 "required": false 4552 } 4553 } 4554 }, 4555 { 4556 "methods": [ 4557 "POST" 4558 ], 4559 "args": { 4560 "parent": { 4561 "description": "The ID for the parent of the autosave.", 4562 "type": "integer", 4563 "required": false 4564 }, 4565 "slug": { 4566 "description": "Unique slug identifying the template.", 4567 "type": "string", 4568 "minLength": 1, 4569 "pattern": "[a-zA-Z_\\-]+", 4570 "required": false 4571 }, 4572 "theme": { 4573 "description": "Theme identifier for the template.", 4574 "type": "string", 4575 "required": false 4576 }, 4577 "content": { 4578 "description": "Content of template.", 4579 "type": [ 4580 "object", 4581 "string" 4582 ], 4583 "required": false 4584 }, 4585 "title": { 4586 "description": "Title of template.", 4587 "type": [ 4588 "object", 4589 "string" 4590 ], 4591 "required": false 4592 }, 4593 "description": { 4594 "description": "Description of template.", 4595 "type": "string", 4596 "required": false 4597 }, 4598 "status": { 4599 "description": "Status of template.", 4600 "type": "string", 4601 "required": false 4602 } 4603 } 4604 } 4605 ] 4606 }, 4607 "/wp/v2/templates/(?P<parent>[\\d]+)/autosaves/(?P<id>[\\d]+)": { 4608 "namespace": "wp/v2", 4609 "methods": [ 4610 "GET" 4611 ], 4612 "endpoints": [ 4613 { 4614 "methods": [ 4615 "GET" 4616 ], 4617 "args": { 4618 "parent": { 4619 "description": "The ID for the parent of the autosave.", 4620 "type": "integer", 4621 "required": false 4622 }, 4623 "id": { 4624 "description": "The ID for the autosave.", 4625 "type": "integer", 4626 "required": false 4627 }, 4628 "context": { 4629 "description": "Scope under which the request is made; determines fields present in response.", 4630 "type": "string", 4631 "enum": [ 4632 "view", 4633 "embed", 4634 "edit" 4635 ], 4636 "default": "view", 4637 "required": false 4638 } 4639 } 4640 } 4641 ] 4642 }, 4643 "/wp/v2/template-parts": { 4644 "namespace": "wp/v2", 4645 "methods": [ 4646 "GET", 4647 "POST" 4648 ], 4649 "endpoints": [ 4650 { 4651 "methods": [ 4652 "GET" 4653 ], 4654 "args": { 4655 "context": { 4656 "description": "Scope under which the request is made; determines fields present in response.", 4657 "type": "string", 4658 "enum": [ 4659 "view", 4660 "embed", 4661 "edit" 4662 ], 4663 "required": false 4664 }, 4665 "wp_id": { 4666 "description": "Limit to the specified post id.", 4667 "type": "integer", 4668 "required": false 4669 }, 4670 "area": { 4671 "description": "Limit to the specified template part area.", 4672 "type": "string", 4673 "required": false 4674 }, 4675 "post_type": { 4676 "description": "Post type to get the templates for.", 4677 "type": "string", 4678 "required": false 4679 } 4680 } 4681 }, 4682 { 4683 "methods": [ 4684 "POST" 4685 ], 4686 "args": { 4687 "slug": { 4688 "description": "Unique slug identifying the template.", 4689 "type": "string", 4690 "minLength": 1, 4691 "pattern": "[a-zA-Z_\\-]+", 4692 "required": true 4693 }, 4694 "theme": { 4695 "description": "Theme identifier for the template.", 4696 "type": "string", 4697 "required": false 4698 }, 4699 "content": { 4700 "default": "", 4701 "description": "Content of template.", 4702 "type": [ 4703 "object", 4704 "string" 4705 ], 4706 "required": false 4707 }, 4708 "title": { 4709 "default": "", 4710 "description": "Title of template.", 4711 "type": [ 4712 "object", 4713 "string" 4714 ], 4715 "required": false 4716 }, 4717 "description": { 4718 "default": "", 4719 "description": "Description of template.", 4720 "type": "string", 4721 "required": false 4722 }, 4723 "status": { 4724 "default": "publish", 4725 "description": "Status of template.", 4726 "type": "string", 4727 "required": false 4728 }, 4729 "area": { 4730 "description": "Where the template part is intended for use (header, footer, etc.)", 4731 "type": "string", 4732 "required": false 4733 } 4734 } 4735 } 4736 ], 4737 "_links": { 4738 "self": [ 4739 { 4740 "href": "http://example.org/index.php?rest_route=/wp/v2/template-parts" 4741 } 4742 ] 4743 } 4744 }, 4745 "/wp/v2/template-parts/(?P<id>[\\/\\w-]+)": { 4746 "namespace": "wp/v2", 4747 "methods": [ 4748 "GET", 4749 "POST", 4750 "PUT", 4751 "PATCH", 4752 "DELETE" 4753 ], 4754 "endpoints": [ 4755 { 4756 "methods": [ 4757 "GET" 4758 ], 4759 "args": { 4760 "id": { 4761 "description": "The id of a template", 4762 "type": "string", 4763 "required": false 4764 } 4765 } 4766 }, 4767 { 4768 "methods": [ 4769 "POST", 4770 "PUT", 4771 "PATCH" 4772 ], 4773 "args": { 4774 "slug": { 4775 "description": "Unique slug identifying the template.", 4776 "type": "string", 4777 "minLength": 1, 4778 "pattern": "[a-zA-Z_\\-]+", 4779 "required": false 4780 }, 4781 "theme": { 4782 "description": "Theme identifier for the template.", 4783 "type": "string", 4784 "required": false 4785 }, 4786 "content": { 4787 "description": "Content of template.", 4788 "type": [ 4789 "object", 4790 "string" 4791 ], 4792 "required": false 4793 }, 4794 "title": { 4795 "description": "Title of template.", 4796 "type": [ 4797 "object", 4798 "string" 4799 ], 4800 "required": false 4801 }, 4802 "description": { 4803 "description": "Description of template.", 4804 "type": "string", 4805 "required": false 4806 }, 4807 "status": { 4808 "description": "Status of template.", 4809 "type": "string", 4810 "required": false 4811 }, 4812 "area": { 4813 "description": "Where the template part is intended for use (header, footer, etc.)", 4814 "type": "string", 4815 "required": false 4816 } 4817 } 4818 }, 4819 { 4820 "methods": [ 4821 "DELETE" 4822 ], 4823 "args": { 4824 "force": { 4825 "type": "boolean", 4826 "default": false, 4827 "description": "Whether to bypass Trash and force deletion.", 4828 "required": false 4829 } 4830 } 4831 } 4832 ] 4833 }, 4834 "/wp/v2/template-parts/(?P<parent>[\\d]+)/revisions": { 4835 "namespace": "wp/v2", 4836 "methods": [ 4837 "GET" 4838 ], 4839 "endpoints": [ 4840 { 4841 "methods": [ 4842 "GET" 4843 ], 4844 "args": { 4845 "parent": { 4846 "description": "The ID for the parent of the revision.", 4847 "type": "integer", 4848 "required": false 4849 }, 4850 "context": { 4851 "description": "Scope under which the request is made; determines fields present in response.", 4852 "type": "string", 4853 "enum": [ 4854 "view", 4855 "embed", 4856 "edit" 4857 ], 4858 "default": "view", 4859 "required": false 4860 }, 4861 "page": { 4862 "description": "Current page of the collection.", 4863 "type": "integer", 4864 "default": 1, 4865 "minimum": 1, 4866 "required": false 4867 }, 4868 "per_page": { 4869 "description": "Maximum number of items to be returned in result set.", 4870 "type": "integer", 4871 "minimum": 1, 4872 "maximum": 100, 4873 "required": false 4874 }, 4875 "search": { 4876 "description": "Limit results to those matching a string.", 4877 "type": "string", 4878 "required": false 4879 }, 4880 "exclude": { 4881 "description": "Ensure result set excludes specific IDs.", 4882 "type": "array", 4883 "items": { 4884 "type": "integer" 4885 }, 4886 "default": [], 4887 "required": false 4888 }, 4889 "include": { 4890 "description": "Limit result set to specific IDs.", 4891 "type": "array", 4892 "items": { 4893 "type": "integer" 4894 }, 4895 "default": [], 4896 "required": false 4897 }, 4898 "offset": { 4899 "description": "Offset the result set by a specific number of items.", 4900 "type": "integer", 4901 "required": false 4902 }, 4903 "order": { 4904 "description": "Order sort attribute ascending or descending.", 4905 "type": "string", 4906 "default": "desc", 4907 "enum": [ 4908 "asc", 4909 "desc" 4910 ], 4911 "required": false 4912 }, 4913 "orderby": { 4914 "description": "Sort collection by object attribute.", 4915 "type": "string", 4916 "default": "date", 4917 "enum": [ 4918 "date", 4919 "id", 4920 "include", 4921 "relevance", 4922 "slug", 4923 "include_slugs", 4924 "title" 4925 ], 4926 "required": false 4927 } 4928 } 4929 } 4930 ] 4931 }, 4932 "/wp/v2/template-parts/(?P<parent>[\\d]+)/revisions/(?P<id>[\\d]+)": { 4933 "namespace": "wp/v2", 4934 "methods": [ 4935 "GET", 4936 "DELETE" 4937 ], 4938 "endpoints": [ 4939 { 4940 "methods": [ 4941 "GET" 4942 ], 4943 "args": { 4944 "parent": { 4945 "description": "The ID for the parent of the revision.", 4946 "type": "integer", 4947 "required": false 4948 }, 4949 "id": { 4950 "description": "Unique identifier for the revision.", 4951 "type": "integer", 4952 "required": false 4953 }, 4954 "context": { 4955 "description": "Scope under which the request is made; determines fields present in response.", 4956 "type": "string", 4957 "enum": [ 4958 "view", 4959 "embed", 4960 "edit" 4961 ], 4962 "default": "view", 4963 "required": false 4964 } 4965 } 4966 }, 4967 { 4968 "methods": [ 4969 "DELETE" 4970 ], 4971 "args": { 4972 "parent": { 4973 "description": "The ID for the parent of the revision.", 4974 "type": "integer", 4975 "required": false 4976 }, 4977 "id": { 4978 "description": "Unique identifier for the revision.", 4979 "type": "integer", 4980 "required": false 4981 }, 4982 "force": { 4983 "type": "boolean", 4984 "default": false, 4985 "description": "Required to be true, as revisions do not support trashing.", 4986 "required": false 4987 } 4988 } 4989 } 4990 ] 4991 }, 4992 "/wp/v2/template-parts/(?P<id>[\\d]+)/autosaves": { 4993 "namespace": "wp/v2", 4994 "methods": [ 4995 "GET", 4996 "POST" 4997 ], 4998 "endpoints": [ 4999 { 5000 "methods": [ 5001 "GET" 5002 ], 5003 "args": { 5004 "parent": { 5005 "description": "The ID for the parent of the autosave.", 5006 "type": "integer", 5007 "required": false 5008 }, 5009 "context": { 5010 "description": "Scope under which the request is made; determines fields present in response.", 5011 "type": "string", 5012 "enum": [ 5013 "view", 5014 "embed", 5015 "edit" 5016 ], 5017 "default": "view", 5018 "required": false 5019 } 5020 } 5021 }, 5022 { 5023 "methods": [ 5024 "POST" 5025 ], 5026 "args": { 5027 "parent": { 5028 "description": "The ID for the parent of the autosave.", 5029 "type": "integer", 5030 "required": false 5031 }, 5032 "slug": { 5033 "description": "Unique slug identifying the template.", 5034 "type": "string", 5035 "minLength": 1, 5036 "pattern": "[a-zA-Z_\\-]+", 5037 "required": false 5038 }, 5039 "theme": { 5040 "description": "Theme identifier for the template.", 5041 "type": "string", 5042 "required": false 5043 }, 5044 "content": { 5045 "description": "Content of template.", 5046 "type": [ 5047 "object", 5048 "string" 5049 ], 5050 "required": false 5051 }, 5052 "title": { 5053 "description": "Title of template.", 5054 "type": [ 5055 "object", 5056 "string" 5057 ], 5058 "required": false 5059 }, 5060 "description": { 5061 "description": "Description of template.", 5062 "type": "string", 5063 "required": false 5064 }, 5065 "status": { 5066 "description": "Status of template.", 5067 "type": "string", 5068 "required": false 5069 }, 5070 "area": { 5071 "description": "Where the template part is intended for use (header, footer, etc.)", 5072 "type": "string", 5073 "required": false 5074 } 5075 } 5076 } 5077 ] 5078 }, 5079 "/wp/v2/template-parts/(?P<parent>[\\d]+)/autosaves/(?P<id>[\\d]+)": { 5080 "namespace": "wp/v2", 5081 "methods": [ 5082 "GET" 5083 ], 5084 "endpoints": [ 5085 { 5086 "methods": [ 5087 "GET" 5088 ], 5089 "args": { 5090 "parent": { 5091 "description": "The ID for the parent of the autosave.", 5092 "type": "integer", 5093 "required": false 5094 }, 5095 "id": { 5096 "description": "The ID for the autosave.", 5097 "type": "integer", 5098 "required": false 5099 }, 5100 "context": { 5101 "description": "Scope under which the request is made; determines fields present in response.", 5102 "type": "string", 5103 "enum": [ 5104 "view", 5105 "embed", 5106 "edit" 5107 ], 5108 "default": "view", 5109 "required": false 5110 } 5111 } 5112 } 5113 ] 5114 }, 5115 "/wp/v2/navigation": { 4320 "/wp/v2/blocks": { 5116 4321 "namespace": "wp/v2", 5117 4322 "methods": [ … … 5324 4529 "type": "string", 5325 4530 "context": [ 4531 "view", 4532 "edit" 4533 ] 4534 } 4535 }, 4536 "required": false 4537 }, 4538 "content": { 4539 "description": "The content for the post.", 4540 "type": "object", 4541 "properties": { 4542 "raw": { 4543 "description": "Content for the post, as it exists in the database.", 4544 "type": "string", 4545 "context": [ 4546 "view", 4547 "edit" 4548 ] 4549 }, 4550 "block_version": { 4551 "description": "Version of the content block format used by the post.", 4552 "type": "integer", 4553 "context": [ 4554 "edit" 4555 ], 4556 "readonly": true 4557 }, 4558 "protected": { 4559 "description": "Whether the content is protected with a password.", 4560 "type": "boolean", 4561 "context": [ 4562 "view", 4563 "edit", 4564 "embed" 4565 ], 4566 "readonly": true 4567 } 4568 }, 4569 "required": false 4570 }, 4571 "template": { 4572 "description": "The theme file to use to display the post.", 4573 "type": "string", 4574 "required": false 4575 } 4576 } 4577 } 4578 ], 4579 "_links": { 4580 "self": "http://example.org/index.php?rest_route=/wp/v2/blocks" 4581 } 4582 }, 4583 "/wp/v2/blocks/(?P<id>[\\d]+)": { 4584 "namespace": "wp/v2", 4585 "methods": [ 4586 "GET", 4587 "POST", 4588 "PUT", 4589 "PATCH", 4590 "DELETE" 4591 ], 4592 "endpoints": [ 4593 { 4594 "methods": [ 4595 "GET" 4596 ], 4597 "allow_batch": { 4598 "v1": true 4599 }, 4600 "args": { 4601 "id": { 4602 "description": "Unique identifier for the post.", 4603 "type": "integer", 4604 "required": false 4605 }, 4606 "context": { 4607 "description": "Scope under which the request is made; determines fields present in response.", 4608 "type": "string", 4609 "enum": [ 4610 "view", 4611 "embed", 4612 "edit" 4613 ], 4614 "default": "view", 4615 "required": false 4616 }, 4617 "password": { 4618 "description": "The password for the post if it is password protected.", 4619 "type": "string", 4620 "required": false 4621 } 4622 } 4623 }, 4624 { 4625 "methods": [ 4626 "POST", 4627 "PUT", 4628 "PATCH" 4629 ], 4630 "allow_batch": { 4631 "v1": true 4632 }, 4633 "args": { 4634 "id": { 4635 "description": "Unique identifier for the post.", 4636 "type": "integer", 4637 "required": false 4638 }, 4639 "date": { 4640 "description": "The date the post was published, in the site's timezone.", 4641 "type": [ 4642 "string", 4643 "null" 4644 ], 4645 "format": "date-time", 4646 "required": false 4647 }, 4648 "date_gmt": { 4649 "description": "The date the post was published, as GMT.", 4650 "type": [ 4651 "string", 4652 "null" 4653 ], 4654 "format": "date-time", 4655 "required": false 4656 }, 4657 "slug": { 4658 "description": "An alphanumeric identifier for the post unique to its type.", 4659 "type": "string", 4660 "required": false 4661 }, 4662 "status": { 4663 "description": "A named status for the post.", 4664 "type": "string", 4665 "enum": [ 4666 "publish", 4667 "future", 4668 "draft", 4669 "pending", 4670 "private" 4671 ], 4672 "required": false 4673 }, 4674 "password": { 4675 "description": "A password to protect access to the content and excerpt.", 4676 "type": "string", 4677 "required": false 4678 }, 4679 "title": { 4680 "description": "The title for the post.", 4681 "type": "object", 4682 "properties": { 4683 "raw": { 4684 "description": "Title for the post, as it exists in the database.", 4685 "type": "string", 4686 "context": [ 4687 "view", 4688 "edit" 4689 ] 4690 } 4691 }, 4692 "required": false 4693 }, 4694 "content": { 4695 "description": "The content for the post.", 4696 "type": "object", 4697 "properties": { 4698 "raw": { 4699 "description": "Content for the post, as it exists in the database.", 4700 "type": "string", 4701 "context": [ 4702 "view", 4703 "edit" 4704 ] 4705 }, 4706 "block_version": { 4707 "description": "Version of the content block format used by the post.", 4708 "type": "integer", 4709 "context": [ 4710 "edit" 4711 ], 4712 "readonly": true 4713 }, 4714 "protected": { 4715 "description": "Whether the content is protected with a password.", 4716 "type": "boolean", 4717 "context": [ 4718 "view", 4719 "edit", 4720 "embed" 4721 ], 4722 "readonly": true 4723 } 4724 }, 4725 "required": false 4726 }, 4727 "template": { 4728 "description": "The theme file to use to display the post.", 4729 "type": "string", 4730 "required": false 4731 } 4732 } 4733 }, 4734 { 4735 "methods": [ 4736 "DELETE" 4737 ], 4738 "allow_batch": { 4739 "v1": true 4740 }, 4741 "args": { 4742 "id": { 4743 "description": "Unique identifier for the post.", 4744 "type": "integer", 4745 "required": false 4746 }, 4747 "force": { 4748 "type": "boolean", 4749 "default": false, 4750 "description": "Whether to bypass Trash and force deletion.", 4751 "required": false 4752 } 4753 } 4754 } 4755 ] 4756 }, 4757 "/wp/v2/blocks/(?P<parent>[\\d]+)/revisions": { 4758 "namespace": "wp/v2", 4759 "methods": [ 4760 "GET" 4761 ], 4762 "endpoints": [ 4763 { 4764 "methods": [ 4765 "GET" 4766 ], 4767 "args": { 4768 "parent": { 4769 "description": "The ID for the parent of the revision.", 4770 "type": "integer", 4771 "required": false 4772 }, 4773 "context": { 4774 "description": "Scope under which the request is made; determines fields present in response.", 4775 "type": "string", 4776 "enum": [ 4777 "view", 4778 "embed", 4779 "edit" 4780 ], 4781 "default": "view", 4782 "required": false 4783 }, 4784 "page": { 4785 "description": "Current page of the collection.", 4786 "type": "integer", 4787 "default": 1, 4788 "minimum": 1, 4789 "required": false 4790 }, 4791 "per_page": { 4792 "description": "Maximum number of items to be returned in result set.", 4793 "type": "integer", 4794 "minimum": 1, 4795 "maximum": 100, 4796 "required": false 4797 }, 4798 "search": { 4799 "description": "Limit results to those matching a string.", 4800 "type": "string", 4801 "required": false 4802 }, 4803 "exclude": { 4804 "description": "Ensure result set excludes specific IDs.", 4805 "type": "array", 4806 "items": { 4807 "type": "integer" 4808 }, 4809 "default": [], 4810 "required": false 4811 }, 4812 "include": { 4813 "description": "Limit result set to specific IDs.", 4814 "type": "array", 4815 "items": { 4816 "type": "integer" 4817 }, 4818 "default": [], 4819 "required": false 4820 }, 4821 "offset": { 4822 "description": "Offset the result set by a specific number of items.", 4823 "type": "integer", 4824 "required": false 4825 }, 4826 "order": { 4827 "description": "Order sort attribute ascending or descending.", 4828 "type": "string", 4829 "default": "desc", 4830 "enum": [ 4831 "asc", 4832 "desc" 4833 ], 4834 "required": false 4835 }, 4836 "orderby": { 4837 "description": "Sort collection by object attribute.", 4838 "type": "string", 4839 "default": "date", 4840 "enum": [ 4841 "date", 4842 "id", 4843 "include", 4844 "relevance", 4845 "slug", 4846 "include_slugs", 4847 "title" 4848 ], 4849 "required": false 4850 } 4851 } 4852 } 4853 ] 4854 }, 4855 "/wp/v2/blocks/(?P<parent>[\\d]+)/revisions/(?P<id>[\\d]+)": { 4856 "namespace": "wp/v2", 4857 "methods": [ 4858 "GET", 4859 "DELETE" 4860 ], 4861 "endpoints": [ 4862 { 4863 "methods": [ 4864 "GET" 4865 ], 4866 "args": { 4867 "parent": { 4868 "description": "The ID for the parent of the revision.", 4869 "type": "integer", 4870 "required": false 4871 }, 4872 "id": { 4873 "description": "Unique identifier for the revision.", 4874 "type": "integer", 4875 "required": false 4876 }, 4877 "context": { 4878 "description": "Scope under which the request is made; determines fields present in response.", 4879 "type": "string", 4880 "enum": [ 4881 "view", 4882 "embed", 4883 "edit" 4884 ], 4885 "default": "view", 4886 "required": false 4887 } 4888 } 4889 }, 4890 { 4891 "methods": [ 4892 "DELETE" 4893 ], 4894 "args": { 4895 "parent": { 4896 "description": "The ID for the parent of the revision.", 4897 "type": "integer", 4898 "required": false 4899 }, 4900 "id": { 4901 "description": "Unique identifier for the revision.", 4902 "type": "integer", 4903 "required": false 4904 }, 4905 "force": { 4906 "type": "boolean", 4907 "default": false, 4908 "description": "Required to be true, as revisions do not support trashing.", 4909 "required": false 4910 } 4911 } 4912 } 4913 ] 4914 }, 4915 "/wp/v2/blocks/(?P<id>[\\d]+)/autosaves": { 4916 "namespace": "wp/v2", 4917 "methods": [ 4918 "GET", 4919 "POST" 4920 ], 4921 "endpoints": [ 4922 { 4923 "methods": [ 4924 "GET" 4925 ], 4926 "args": { 4927 "parent": { 4928 "description": "The ID for the parent of the autosave.", 4929 "type": "integer", 4930 "required": false 4931 }, 4932 "context": { 4933 "description": "Scope under which the request is made; determines fields present in response.", 4934 "type": "string", 4935 "enum": [ 4936 "view", 4937 "embed", 4938 "edit" 4939 ], 4940 "default": "view", 4941 "required": false 4942 } 4943 } 4944 }, 4945 { 4946 "methods": [ 4947 "POST" 4948 ], 4949 "args": { 4950 "parent": { 4951 "description": "The ID for the parent of the autosave.", 4952 "type": "integer", 4953 "required": false 4954 }, 4955 "date": { 4956 "description": "The date the post was published, in the site's timezone.", 4957 "type": [ 4958 "string", 4959 "null" 4960 ], 4961 "format": "date-time", 4962 "required": false 4963 }, 4964 "date_gmt": { 4965 "description": "The date the post was published, as GMT.", 4966 "type": [ 4967 "string", 4968 "null" 4969 ], 4970 "format": "date-time", 4971 "required": false 4972 }, 4973 "slug": { 4974 "description": "An alphanumeric identifier for the post unique to its type.", 4975 "type": "string", 4976 "required": false 4977 }, 4978 "status": { 4979 "description": "A named status for the post.", 4980 "type": "string", 4981 "enum": [ 4982 "publish", 4983 "future", 4984 "draft", 4985 "pending", 4986 "private" 4987 ], 4988 "required": false 4989 }, 4990 "password": { 4991 "description": "A password to protect access to the content and excerpt.", 4992 "type": "string", 4993 "required": false 4994 }, 4995 "title": { 4996 "description": "The title for the post.", 4997 "type": "object", 4998 "properties": { 4999 "raw": { 5000 "description": "Title for the post, as it exists in the database.", 5001 "type": "string", 5002 "context": [ 5003 "view", 5004 "edit" 5005 ] 5006 } 5007 }, 5008 "required": false 5009 }, 5010 "content": { 5011 "description": "The content for the post.", 5012 "type": "object", 5013 "properties": { 5014 "raw": { 5015 "description": "Content for the post, as it exists in the database.", 5016 "type": "string", 5017 "context": [ 5018 "view", 5019 "edit" 5020 ] 5021 }, 5022 "block_version": { 5023 "description": "Version of the content block format used by the post.", 5024 "type": "integer", 5025 "context": [ 5026 "edit" 5027 ], 5028 "readonly": true 5029 }, 5030 "protected": { 5031 "description": "Whether the content is protected with a password.", 5032 "type": "boolean", 5033 "context": [ 5034 "view", 5035 "edit", 5036 "embed" 5037 ], 5038 "readonly": true 5039 } 5040 }, 5041 "required": false 5042 }, 5043 "template": { 5044 "description": "The theme file to use to display the post.", 5045 "type": "string", 5046 "required": false 5047 } 5048 } 5049 } 5050 ] 5051 }, 5052 "/wp/v2/blocks/(?P<parent>[\\d]+)/autosaves/(?P<id>[\\d]+)": { 5053 "namespace": "wp/v2", 5054 "methods": [ 5055 "GET" 5056 ], 5057 "endpoints": [ 5058 { 5059 "methods": [ 5060 "GET" 5061 ], 5062 "args": { 5063 "parent": { 5064 "description": "The ID for the parent of the autosave.", 5065 "type": "integer", 5066 "required": false 5067 }, 5068 "id": { 5069 "description": "The ID for the autosave.", 5070 "type": "integer", 5071 "required": false 5072 }, 5073 "context": { 5074 "description": "Scope under which the request is made; determines fields present in response.", 5075 "type": "string", 5076 "enum": [ 5077 "view", 5078 "embed", 5079 "edit" 5080 ], 5081 "default": "view", 5082 "required": false 5083 } 5084 } 5085 } 5086 ] 5087 }, 5088 "/wp/v2/templates": { 5089 "namespace": "wp/v2", 5090 "methods": [ 5091 "GET", 5092 "POST" 5093 ], 5094 "endpoints": [ 5095 { 5096 "methods": [ 5097 "GET" 5098 ], 5099 "args": { 5100 "context": { 5101 "description": "Scope under which the request is made; determines fields present in response.", 5102 "type": "string", 5103 "enum": [ 5104 "view", 5105 "embed", 5106 "edit" 5107 ], 5108 "required": false 5109 }, 5110 "wp_id": { 5111 "description": "Limit to the specified post id.", 5112 "type": "integer", 5113 "required": false 5114 }, 5115 "area": { 5116 "description": "Limit to the specified template part area.", 5117 "type": "string", 5118 "required": false 5119 }, 5120 "post_type": { 5121 "description": "Post type to get the templates for.", 5122 "type": "string", 5123 "required": false 5124 } 5125 } 5126 }, 5127 { 5128 "methods": [ 5129 "POST" 5130 ], 5131 "args": { 5132 "slug": { 5133 "description": "Unique slug identifying the template.", 5134 "type": "string", 5135 "minLength": 1, 5136 "pattern": "[a-zA-Z_\\-]+", 5137 "required": true 5138 }, 5139 "theme": { 5140 "description": "Theme identifier for the template.", 5141 "type": "string", 5142 "required": false 5143 }, 5144 "content": { 5145 "default": "", 5146 "description": "Content of template.", 5147 "type": [ 5148 "object", 5149 "string" 5150 ], 5151 "required": false 5152 }, 5153 "title": { 5154 "default": "", 5155 "description": "Title of template.", 5156 "type": [ 5157 "object", 5158 "string" 5159 ], 5160 "required": false 5161 }, 5162 "description": { 5163 "default": "", 5164 "description": "Description of template.", 5165 "type": "string", 5166 "required": false 5167 }, 5168 "status": { 5169 "default": "publish", 5170 "description": "Status of template.", 5171 "type": "string", 5172 "required": false 5173 } 5174 } 5175 } 5176 ], 5177 "_links": { 5178 "self": [ 5179 { 5180 "href": "http://example.org/index.php?rest_route=/wp/v2/templates" 5181 } 5182 ] 5183 } 5184 }, 5185 "/wp/v2/templates/(?P<id>[\\/\\w-]+)": { 5186 "namespace": "wp/v2", 5187 "methods": [ 5188 "GET", 5189 "POST", 5190 "PUT", 5191 "PATCH", 5192 "DELETE" 5193 ], 5194 "endpoints": [ 5195 { 5196 "methods": [ 5197 "GET" 5198 ], 5199 "args": { 5200 "id": { 5201 "description": "The id of a template", 5202 "type": "string", 5203 "required": false 5204 } 5205 } 5206 }, 5207 { 5208 "methods": [ 5209 "POST", 5210 "PUT", 5211 "PATCH" 5212 ], 5213 "args": { 5214 "slug": { 5215 "description": "Unique slug identifying the template.", 5216 "type": "string", 5217 "minLength": 1, 5218 "pattern": "[a-zA-Z_\\-]+", 5219 "required": false 5220 }, 5221 "theme": { 5222 "description": "Theme identifier for the template.", 5223 "type": "string", 5224 "required": false 5225 }, 5226 "content": { 5227 "description": "Content of template.", 5228 "type": [ 5229 "object", 5230 "string" 5231 ], 5232 "required": false 5233 }, 5234 "title": { 5235 "description": "Title of template.", 5236 "type": [ 5237 "object", 5238 "string" 5239 ], 5240 "required": false 5241 }, 5242 "description": { 5243 "description": "Description of template.", 5244 "type": "string", 5245 "required": false 5246 }, 5247 "status": { 5248 "description": "Status of template.", 5249 "type": "string", 5250 "required": false 5251 } 5252 } 5253 }, 5254 { 5255 "methods": [ 5256 "DELETE" 5257 ], 5258 "args": { 5259 "force": { 5260 "type": "boolean", 5261 "default": false, 5262 "description": "Whether to bypass Trash and force deletion.", 5263 "required": false 5264 } 5265 } 5266 } 5267 ] 5268 }, 5269 "/wp/v2/templates/(?P<parent>[\\d]+)/revisions": { 5270 "namespace": "wp/v2", 5271 "methods": [ 5272 "GET" 5273 ], 5274 "endpoints": [ 5275 { 5276 "methods": [ 5277 "GET" 5278 ], 5279 "args": { 5280 "parent": { 5281 "description": "The ID for the parent of the revision.", 5282 "type": "integer", 5283 "required": false 5284 }, 5285 "context": { 5286 "description": "Scope under which the request is made; determines fields present in response.", 5287 "type": "string", 5288 "enum": [ 5289 "view", 5290 "embed", 5291 "edit" 5292 ], 5293 "default": "view", 5294 "required": false 5295 }, 5296 "page": { 5297 "description": "Current page of the collection.", 5298 "type": "integer", 5299 "default": 1, 5300 "minimum": 1, 5301 "required": false 5302 }, 5303 "per_page": { 5304 "description": "Maximum number of items to be returned in result set.", 5305 "type": "integer", 5306 "minimum": 1, 5307 "maximum": 100, 5308 "required": false 5309 }, 5310 "search": { 5311 "description": "Limit results to those matching a string.", 5312 "type": "string", 5313 "required": false 5314 }, 5315 "exclude": { 5316 "description": "Ensure result set excludes specific IDs.", 5317 "type": "array", 5318 "items": { 5319 "type": "integer" 5320 }, 5321 "default": [], 5322 "required": false 5323 }, 5324 "include": { 5325 "description": "Limit result set to specific IDs.", 5326 "type": "array", 5327 "items": { 5328 "type": "integer" 5329 }, 5330 "default": [], 5331 "required": false 5332 }, 5333 "offset": { 5334 "description": "Offset the result set by a specific number of items.", 5335 "type": "integer", 5336 "required": false 5337 }, 5338 "order": { 5339 "description": "Order sort attribute ascending or descending.", 5340 "type": "string", 5341 "default": "desc", 5342 "enum": [ 5343 "asc", 5344 "desc" 5345 ], 5346 "required": false 5347 }, 5348 "orderby": { 5349 "description": "Sort collection by object attribute.", 5350 "type": "string", 5351 "default": "date", 5352 "enum": [ 5353 "date", 5354 "id", 5355 "include", 5356 "relevance", 5357 "slug", 5358 "include_slugs", 5359 "title" 5360 ], 5361 "required": false 5362 } 5363 } 5364 } 5365 ] 5366 }, 5367 "/wp/v2/templates/(?P<parent>[\\d]+)/revisions/(?P<id>[\\d]+)": { 5368 "namespace": "wp/v2", 5369 "methods": [ 5370 "GET", 5371 "DELETE" 5372 ], 5373 "endpoints": [ 5374 { 5375 "methods": [ 5376 "GET" 5377 ], 5378 "args": { 5379 "parent": { 5380 "description": "The ID for the parent of the revision.", 5381 "type": "integer", 5382 "required": false 5383 }, 5384 "id": { 5385 "description": "Unique identifier for the revision.", 5386 "type": "integer", 5387 "required": false 5388 }, 5389 "context": { 5390 "description": "Scope under which the request is made; determines fields present in response.", 5391 "type": "string", 5392 "enum": [ 5393 "view", 5394 "embed", 5395 "edit" 5396 ], 5397 "default": "view", 5398 "required": false 5399 } 5400 } 5401 }, 5402 { 5403 "methods": [ 5404 "DELETE" 5405 ], 5406 "args": { 5407 "parent": { 5408 "description": "The ID for the parent of the revision.", 5409 "type": "integer", 5410 "required": false 5411 }, 5412 "id": { 5413 "description": "Unique identifier for the revision.", 5414 "type": "integer", 5415 "required": false 5416 }, 5417 "force": { 5418 "type": "boolean", 5419 "default": false, 5420 "description": "Required to be true, as revisions do not support trashing.", 5421 "required": false 5422 } 5423 } 5424 } 5425 ] 5426 }, 5427 "/wp/v2/templates/(?P<id>[\\d]+)/autosaves": { 5428 "namespace": "wp/v2", 5429 "methods": [ 5430 "GET", 5431 "POST" 5432 ], 5433 "endpoints": [ 5434 { 5435 "methods": [ 5436 "GET" 5437 ], 5438 "args": { 5439 "parent": { 5440 "description": "The ID for the parent of the autosave.", 5441 "type": "integer", 5442 "required": false 5443 }, 5444 "context": { 5445 "description": "Scope under which the request is made; determines fields present in response.", 5446 "type": "string", 5447 "enum": [ 5448 "view", 5449 "embed", 5450 "edit" 5451 ], 5452 "default": "view", 5453 "required": false 5454 } 5455 } 5456 }, 5457 { 5458 "methods": [ 5459 "POST" 5460 ], 5461 "args": { 5462 "parent": { 5463 "description": "The ID for the parent of the autosave.", 5464 "type": "integer", 5465 "required": false 5466 }, 5467 "slug": { 5468 "description": "Unique slug identifying the template.", 5469 "type": "string", 5470 "minLength": 1, 5471 "pattern": "[a-zA-Z_\\-]+", 5472 "required": false 5473 }, 5474 "theme": { 5475 "description": "Theme identifier for the template.", 5476 "type": "string", 5477 "required": false 5478 }, 5479 "content": { 5480 "description": "Content of template.", 5481 "type": [ 5482 "object", 5483 "string" 5484 ], 5485 "required": false 5486 }, 5487 "title": { 5488 "description": "Title of template.", 5489 "type": [ 5490 "object", 5491 "string" 5492 ], 5493 "required": false 5494 }, 5495 "description": { 5496 "description": "Description of template.", 5497 "type": "string", 5498 "required": false 5499 }, 5500 "status": { 5501 "description": "Status of template.", 5502 "type": "string", 5503 "required": false 5504 } 5505 } 5506 } 5507 ] 5508 }, 5509 "/wp/v2/templates/(?P<parent>[\\d]+)/autosaves/(?P<id>[\\d]+)": { 5510 "namespace": "wp/v2", 5511 "methods": [ 5512 "GET" 5513 ], 5514 "endpoints": [ 5515 { 5516 "methods": [ 5517 "GET" 5518 ], 5519 "args": { 5520 "parent": { 5521 "description": "The ID for the parent of the autosave.", 5522 "type": "integer", 5523 "required": false 5524 }, 5525 "id": { 5526 "description": "The ID for the autosave.", 5527 "type": "integer", 5528 "required": false 5529 }, 5530 "context": { 5531 "description": "Scope under which the request is made; determines fields present in response.", 5532 "type": "string", 5533 "enum": [ 5534 "view", 5535 "embed", 5536 "edit" 5537 ], 5538 "default": "view", 5539 "required": false 5540 } 5541 } 5542 } 5543 ] 5544 }, 5545 "/wp/v2/template-parts": { 5546 "namespace": "wp/v2", 5547 "methods": [ 5548 "GET", 5549 "POST" 5550 ], 5551 "endpoints": [ 5552 { 5553 "methods": [ 5554 "GET" 5555 ], 5556 "args": { 5557 "context": { 5558 "description": "Scope under which the request is made; determines fields present in response.", 5559 "type": "string", 5560 "enum": [ 5561 "view", 5562 "embed", 5563 "edit" 5564 ], 5565 "required": false 5566 }, 5567 "wp_id": { 5568 "description": "Limit to the specified post id.", 5569 "type": "integer", 5570 "required": false 5571 }, 5572 "area": { 5573 "description": "Limit to the specified template part area.", 5574 "type": "string", 5575 "required": false 5576 }, 5577 "post_type": { 5578 "description": "Post type to get the templates for.", 5579 "type": "string", 5580 "required": false 5581 } 5582 } 5583 }, 5584 { 5585 "methods": [ 5586 "POST" 5587 ], 5588 "args": { 5589 "slug": { 5590 "description": "Unique slug identifying the template.", 5591 "type": "string", 5592 "minLength": 1, 5593 "pattern": "[a-zA-Z_\\-]+", 5594 "required": true 5595 }, 5596 "theme": { 5597 "description": "Theme identifier for the template.", 5598 "type": "string", 5599 "required": false 5600 }, 5601 "content": { 5602 "default": "", 5603 "description": "Content of template.", 5604 "type": [ 5605 "object", 5606 "string" 5607 ], 5608 "required": false 5609 }, 5610 "title": { 5611 "default": "", 5612 "description": "Title of template.", 5613 "type": [ 5614 "object", 5615 "string" 5616 ], 5617 "required": false 5618 }, 5619 "description": { 5620 "default": "", 5621 "description": "Description of template.", 5622 "type": "string", 5623 "required": false 5624 }, 5625 "status": { 5626 "default": "publish", 5627 "description": "Status of template.", 5628 "type": "string", 5629 "required": false 5630 }, 5631 "area": { 5632 "description": "Where the template part is intended for use (header, footer, etc.)", 5633 "type": "string", 5634 "required": false 5635 } 5636 } 5637 } 5638 ], 5639 "_links": { 5640 "self": [ 5641 { 5642 "href": "http://example.org/index.php?rest_route=/wp/v2/template-parts" 5643 } 5644 ] 5645 } 5646 }, 5647 "/wp/v2/template-parts/(?P<id>[\\/\\w-]+)": { 5648 "namespace": "wp/v2", 5649 "methods": [ 5650 "GET", 5651 "POST", 5652 "PUT", 5653 "PATCH", 5654 "DELETE" 5655 ], 5656 "endpoints": [ 5657 { 5658 "methods": [ 5659 "GET" 5660 ], 5661 "args": { 5662 "id": { 5663 "description": "The id of a template", 5664 "type": "string", 5665 "required": false 5666 } 5667 } 5668 }, 5669 { 5670 "methods": [ 5671 "POST", 5672 "PUT", 5673 "PATCH" 5674 ], 5675 "args": { 5676 "slug": { 5677 "description": "Unique slug identifying the template.", 5678 "type": "string", 5679 "minLength": 1, 5680 "pattern": "[a-zA-Z_\\-]+", 5681 "required": false 5682 }, 5683 "theme": { 5684 "description": "Theme identifier for the template.", 5685 "type": "string", 5686 "required": false 5687 }, 5688 "content": { 5689 "description": "Content of template.", 5690 "type": [ 5691 "object", 5692 "string" 5693 ], 5694 "required": false 5695 }, 5696 "title": { 5697 "description": "Title of template.", 5698 "type": [ 5699 "object", 5700 "string" 5701 ], 5702 "required": false 5703 }, 5704 "description": { 5705 "description": "Description of template.", 5706 "type": "string", 5707 "required": false 5708 }, 5709 "status": { 5710 "description": "Status of template.", 5711 "type": "string", 5712 "required": false 5713 }, 5714 "area": { 5715 "description": "Where the template part is intended for use (header, footer, etc.)", 5716 "type": "string", 5717 "required": false 5718 } 5719 } 5720 }, 5721 { 5722 "methods": [ 5723 "DELETE" 5724 ], 5725 "args": { 5726 "force": { 5727 "type": "boolean", 5728 "default": false, 5729 "description": "Whether to bypass Trash and force deletion.", 5730 "required": false 5731 } 5732 } 5733 } 5734 ] 5735 }, 5736 "/wp/v2/template-parts/(?P<parent>[\\d]+)/revisions": { 5737 "namespace": "wp/v2", 5738 "methods": [ 5739 "GET" 5740 ], 5741 "endpoints": [ 5742 { 5743 "methods": [ 5744 "GET" 5745 ], 5746 "args": { 5747 "parent": { 5748 "description": "The ID for the parent of the revision.", 5749 "type": "integer", 5750 "required": false 5751 }, 5752 "context": { 5753 "description": "Scope under which the request is made; determines fields present in response.", 5754 "type": "string", 5755 "enum": [ 5756 "view", 5757 "embed", 5758 "edit" 5759 ], 5760 "default": "view", 5761 "required": false 5762 }, 5763 "page": { 5764 "description": "Current page of the collection.", 5765 "type": "integer", 5766 "default": 1, 5767 "minimum": 1, 5768 "required": false 5769 }, 5770 "per_page": { 5771 "description": "Maximum number of items to be returned in result set.", 5772 "type": "integer", 5773 "minimum": 1, 5774 "maximum": 100, 5775 "required": false 5776 }, 5777 "search": { 5778 "description": "Limit results to those matching a string.", 5779 "type": "string", 5780 "required": false 5781 }, 5782 "exclude": { 5783 "description": "Ensure result set excludes specific IDs.", 5784 "type": "array", 5785 "items": { 5786 "type": "integer" 5787 }, 5788 "default": [], 5789 "required": false 5790 }, 5791 "include": { 5792 "description": "Limit result set to specific IDs.", 5793 "type": "array", 5794 "items": { 5795 "type": "integer" 5796 }, 5797 "default": [], 5798 "required": false 5799 }, 5800 "offset": { 5801 "description": "Offset the result set by a specific number of items.", 5802 "type": "integer", 5803 "required": false 5804 }, 5805 "order": { 5806 "description": "Order sort attribute ascending or descending.", 5807 "type": "string", 5808 "default": "desc", 5809 "enum": [ 5810 "asc", 5811 "desc" 5812 ], 5813 "required": false 5814 }, 5815 "orderby": { 5816 "description": "Sort collection by object attribute.", 5817 "type": "string", 5818 "default": "date", 5819 "enum": [ 5820 "date", 5821 "id", 5822 "include", 5823 "relevance", 5824 "slug", 5825 "include_slugs", 5826 "title" 5827 ], 5828 "required": false 5829 } 5830 } 5831 } 5832 ] 5833 }, 5834 "/wp/v2/template-parts/(?P<parent>[\\d]+)/revisions/(?P<id>[\\d]+)": { 5835 "namespace": "wp/v2", 5836 "methods": [ 5837 "GET", 5838 "DELETE" 5839 ], 5840 "endpoints": [ 5841 { 5842 "methods": [ 5843 "GET" 5844 ], 5845 "args": { 5846 "parent": { 5847 "description": "The ID for the parent of the revision.", 5848 "type": "integer", 5849 "required": false 5850 }, 5851 "id": { 5852 "description": "Unique identifier for the revision.", 5853 "type": "integer", 5854 "required": false 5855 }, 5856 "context": { 5857 "description": "Scope under which the request is made; determines fields present in response.", 5858 "type": "string", 5859 "enum": [ 5860 "view", 5861 "embed", 5862 "edit" 5863 ], 5864 "default": "view", 5865 "required": false 5866 } 5867 } 5868 }, 5869 { 5870 "methods": [ 5871 "DELETE" 5872 ], 5873 "args": { 5874 "parent": { 5875 "description": "The ID for the parent of the revision.", 5876 "type": "integer", 5877 "required": false 5878 }, 5879 "id": { 5880 "description": "Unique identifier for the revision.", 5881 "type": "integer", 5882 "required": false 5883 }, 5884 "force": { 5885 "type": "boolean", 5886 "default": false, 5887 "description": "Required to be true, as revisions do not support trashing.", 5888 "required": false 5889 } 5890 } 5891 } 5892 ] 5893 }, 5894 "/wp/v2/template-parts/(?P<id>[\\d]+)/autosaves": { 5895 "namespace": "wp/v2", 5896 "methods": [ 5897 "GET", 5898 "POST" 5899 ], 5900 "endpoints": [ 5901 { 5902 "methods": [ 5903 "GET" 5904 ], 5905 "args": { 5906 "parent": { 5907 "description": "The ID for the parent of the autosave.", 5908 "type": "integer", 5909 "required": false 5910 }, 5911 "context": { 5912 "description": "Scope under which the request is made; determines fields present in response.", 5913 "type": "string", 5914 "enum": [ 5915 "view", 5916 "embed", 5917 "edit" 5918 ], 5919 "default": "view", 5920 "required": false 5921 } 5922 } 5923 }, 5924 { 5925 "methods": [ 5926 "POST" 5927 ], 5928 "args": { 5929 "parent": { 5930 "description": "The ID for the parent of the autosave.", 5931 "type": "integer", 5932 "required": false 5933 }, 5934 "slug": { 5935 "description": "Unique slug identifying the template.", 5936 "type": "string", 5937 "minLength": 1, 5938 "pattern": "[a-zA-Z_\\-]+", 5939 "required": false 5940 }, 5941 "theme": { 5942 "description": "Theme identifier for the template.", 5943 "type": "string", 5944 "required": false 5945 }, 5946 "content": { 5947 "description": "Content of template.", 5948 "type": [ 5949 "object", 5950 "string" 5951 ], 5952 "required": false 5953 }, 5954 "title": { 5955 "description": "Title of template.", 5956 "type": [ 5957 "object", 5958 "string" 5959 ], 5960 "required": false 5961 }, 5962 "description": { 5963 "description": "Description of template.", 5964 "type": "string", 5965 "required": false 5966 }, 5967 "status": { 5968 "description": "Status of template.", 5969 "type": "string", 5970 "required": false 5971 }, 5972 "area": { 5973 "description": "Where the template part is intended for use (header, footer, etc.)", 5974 "type": "string", 5975 "required": false 5976 } 5977 } 5978 } 5979 ] 5980 }, 5981 "/wp/v2/template-parts/(?P<parent>[\\d]+)/autosaves/(?P<id>[\\d]+)": { 5982 "namespace": "wp/v2", 5983 "methods": [ 5984 "GET" 5985 ], 5986 "endpoints": [ 5987 { 5988 "methods": [ 5989 "GET" 5990 ], 5991 "args": { 5992 "parent": { 5993 "description": "The ID for the parent of the autosave.", 5994 "type": "integer", 5995 "required": false 5996 }, 5997 "id": { 5998 "description": "The ID for the autosave.", 5999 "type": "integer", 6000 "required": false 6001 }, 6002 "context": { 6003 "description": "Scope under which the request is made; determines fields present in response.", 6004 "type": "string", 6005 "enum": [ 6006 "view", 6007 "embed", 6008 "edit" 6009 ], 6010 "default": "view", 6011 "required": false 6012 } 6013 } 6014 } 6015 ] 6016 }, 6017 "/wp/v2/navigation": { 6018 "namespace": "wp/v2", 6019 "methods": [ 6020 "GET", 6021 "POST" 6022 ], 6023 "endpoints": [ 6024 { 6025 "methods": [ 6026 "GET" 6027 ], 6028 "allow_batch": { 6029 "v1": true 6030 }, 6031 "args": { 6032 "context": { 6033 "description": "Scope under which the request is made; determines fields present in response.", 6034 "type": "string", 6035 "enum": [ 6036 "view", 6037 "embed", 6038 "edit" 6039 ], 6040 "default": "view", 6041 "required": false 6042 }, 6043 "page": { 6044 "description": "Current page of the collection.", 6045 "type": "integer", 6046 "default": 1, 6047 "minimum": 1, 6048 "required": false 6049 }, 6050 "per_page": { 6051 "description": "Maximum number of items to be returned in result set.", 6052 "type": "integer", 6053 "default": 10, 6054 "minimum": 1, 6055 "maximum": 100, 6056 "required": false 6057 }, 6058 "search": { 6059 "description": "Limit results to those matching a string.", 6060 "type": "string", 6061 "required": false 6062 }, 6063 "after": { 6064 "description": "Limit response to posts published after a given ISO8601 compliant date.", 6065 "type": "string", 6066 "format": "date-time", 6067 "required": false 6068 }, 6069 "modified_after": { 6070 "description": "Limit response to posts modified after a given ISO8601 compliant date.", 6071 "type": "string", 6072 "format": "date-time", 6073 "required": false 6074 }, 6075 "before": { 6076 "description": "Limit response to posts published before a given ISO8601 compliant date.", 6077 "type": "string", 6078 "format": "date-time", 6079 "required": false 6080 }, 6081 "modified_before": { 6082 "description": "Limit response to posts modified before a given ISO8601 compliant date.", 6083 "type": "string", 6084 "format": "date-time", 6085 "required": false 6086 }, 6087 "exclude": { 6088 "description": "Ensure result set excludes specific IDs.", 6089 "type": "array", 6090 "items": { 6091 "type": "integer" 6092 }, 6093 "default": [], 6094 "required": false 6095 }, 6096 "include": { 6097 "description": "Limit result set to specific IDs.", 6098 "type": "array", 6099 "items": { 6100 "type": "integer" 6101 }, 6102 "default": [], 6103 "required": false 6104 }, 6105 "offset": { 6106 "description": "Offset the result set by a specific number of items.", 6107 "type": "integer", 6108 "required": false 6109 }, 6110 "order": { 6111 "description": "Order sort attribute ascending or descending.", 6112 "type": "string", 6113 "default": "desc", 6114 "enum": [ 6115 "asc", 6116 "desc" 6117 ], 6118 "required": false 6119 }, 6120 "orderby": { 6121 "description": "Sort collection by post attribute.", 6122 "type": "string", 6123 "default": "date", 6124 "enum": [ 6125 "author", 6126 "date", 6127 "id", 6128 "include", 6129 "modified", 6130 "parent", 6131 "relevance", 6132 "slug", 6133 "include_slugs", 6134 "title" 6135 ], 6136 "required": false 6137 }, 6138 "slug": { 6139 "description": "Limit result set to posts with one or more specific slugs.", 6140 "type": "array", 6141 "items": { 6142 "type": "string" 6143 }, 6144 "required": false 6145 }, 6146 "status": { 6147 "default": "publish", 6148 "description": "Limit result set to posts assigned one or more statuses.", 6149 "type": "array", 6150 "items": { 6151 "enum": [ 6152 "publish", 6153 "future", 6154 "draft", 6155 "pending", 6156 "private", 6157 "trash", 6158 "auto-draft", 6159 "inherit", 6160 "request-pending", 6161 "request-confirmed", 6162 "request-failed", 6163 "request-completed", 6164 "any" 6165 ], 6166 "type": "string" 6167 }, 6168 "required": false 6169 } 6170 } 6171 }, 6172 { 6173 "methods": [ 6174 "POST" 6175 ], 6176 "allow_batch": { 6177 "v1": true 6178 }, 6179 "args": { 6180 "date": { 6181 "description": "The date the post was published, in the site's timezone.", 6182 "type": [ 6183 "string", 6184 "null" 6185 ], 6186 "format": "date-time", 6187 "required": false 6188 }, 6189 "date_gmt": { 6190 "description": "The date the post was published, as GMT.", 6191 "type": [ 6192 "string", 6193 "null" 6194 ], 6195 "format": "date-time", 6196 "required": false 6197 }, 6198 "slug": { 6199 "description": "An alphanumeric identifier for the post unique to its type.", 6200 "type": "string", 6201 "required": false 6202 }, 6203 "status": { 6204 "description": "A named status for the post.", 6205 "type": "string", 6206 "enum": [ 6207 "publish", 6208 "future", 6209 "draft", 6210 "pending", 6211 "private" 6212 ], 6213 "required": false 6214 }, 6215 "password": { 6216 "description": "A password to protect access to the content and excerpt.", 6217 "type": "string", 6218 "required": false 6219 }, 6220 "title": { 6221 "description": "The title for the post.", 6222 "type": "object", 6223 "properties": { 6224 "raw": { 6225 "description": "Title for the post, as it exists in the database.", 6226 "type": "string", 6227 "context": [ 5326 6228 "edit" 5327 6229 ] … … 6631 7533 ] 6632 7534 }, 7535 "/wp/v2/menus": { 7536 "namespace": "wp/v2", 7537 "methods": [ 7538 "GET", 7539 "POST" 7540 ], 7541 "endpoints": [ 7542 { 7543 "methods": [ 7544 "GET" 7545 ], 7546 "allow_batch": { 7547 "v1": true 7548 }, 7549 "args": { 7550 "context": { 7551 "description": "Scope under which the request is made; determines fields present in response.", 7552 "type": "string", 7553 "enum": [ 7554 "view", 7555 "embed", 7556 "edit" 7557 ], 7558 "default": "view", 7559 "required": false 7560 }, 7561 "page": { 7562 "description": "Current page of the collection.", 7563 "type": "integer", 7564 "default": 1, 7565 "minimum": 1, 7566 "required": false 7567 }, 7568 "per_page": { 7569 "description": "Maximum number of items to be returned in result set.", 7570 "type": "integer", 7571 "default": 10, 7572 "minimum": 1, 7573 "maximum": 100, 7574 "required": false 7575 }, 7576 "search": { 7577 "description": "Limit results to those matching a string.", 7578 "type": "string", 7579 "required": false 7580 }, 7581 "exclude": { 7582 "description": "Ensure result set excludes specific IDs.", 7583 "type": "array", 7584 "items": { 7585 "type": "integer" 7586 }, 7587 "default": [], 7588 "required": false 7589 }, 7590 "include": { 7591 "description": "Limit result set to specific IDs.", 7592 "type": "array", 7593 "items": { 7594 "type": "integer" 7595 }, 7596 "default": [], 7597 "required": false 7598 }, 7599 "offset": { 7600 "description": "Offset the result set by a specific number of items.", 7601 "type": "integer", 7602 "required": false 7603 }, 7604 "order": { 7605 "description": "Order sort attribute ascending or descending.", 7606 "type": "string", 7607 "default": "asc", 7608 "enum": [ 7609 "asc", 7610 "desc" 7611 ], 7612 "required": false 7613 }, 7614 "orderby": { 7615 "description": "Sort collection by term attribute.", 7616 "type": "string", 7617 "default": "name", 7618 "enum": [ 7619 "id", 7620 "include", 7621 "name", 7622 "slug", 7623 "include_slugs", 7624 "term_group", 7625 "description", 7626 "count" 7627 ], 7628 "required": false 7629 }, 7630 "hide_empty": { 7631 "description": "Whether to hide terms not assigned to any posts.", 7632 "type": "boolean", 7633 "default": false, 7634 "required": false 7635 }, 7636 "post": { 7637 "description": "Limit result set to terms assigned to a specific post.", 7638 "type": "integer", 7639 "default": null, 7640 "required": false 7641 }, 7642 "slug": { 7643 "description": "Limit result set to terms with one or more specific slugs.", 7644 "type": "array", 7645 "items": { 7646 "type": "string" 7647 }, 7648 "required": false 7649 } 7650 } 7651 }, 7652 { 7653 "methods": [ 7654 "POST" 7655 ], 7656 "allow_batch": { 7657 "v1": true 7658 }, 7659 "args": { 7660 "description": { 7661 "description": "HTML description of the term.", 7662 "type": "string", 7663 "required": false 7664 }, 7665 "name": { 7666 "description": "HTML title for the term.", 7667 "type": "string", 7668 "required": true 7669 }, 7670 "slug": { 7671 "description": "An alphanumeric identifier for the term unique to its type.", 7672 "type": "string", 7673 "required": false 7674 }, 7675 "meta": { 7676 "description": "Meta fields.", 7677 "type": "object", 7678 "properties": [], 7679 "required": false 7680 }, 7681 "locations": { 7682 "description": "The locations assigned to the menu.", 7683 "type": "array", 7684 "items": { 7685 "type": "string" 7686 }, 7687 "required": false 7688 }, 7689 "auto_add": { 7690 "description": "Whether to automatically add top level pages to this menu.", 7691 "type": "boolean", 7692 "required": false 7693 } 7694 } 7695 } 7696 ], 7697 "_links": { 7698 "self": [ 7699 { 7700 "href": "http://example.org/index.php?rest_route=/wp/v2/menus" 7701 } 7702 ] 7703 } 7704 }, 7705 "/wp/v2/menus/(?P<id>[\\d]+)": { 7706 "namespace": "wp/v2", 7707 "methods": [ 7708 "GET", 7709 "POST", 7710 "PUT", 7711 "PATCH", 7712 "DELETE" 7713 ], 7714 "endpoints": [ 7715 { 7716 "methods": [ 7717 "GET" 7718 ], 7719 "allow_batch": { 7720 "v1": true 7721 }, 7722 "args": { 7723 "id": { 7724 "description": "Unique identifier for the term.", 7725 "type": "integer", 7726 "required": false 7727 }, 7728 "context": { 7729 "description": "Scope under which the request is made; determines fields present in response.", 7730 "type": "string", 7731 "enum": [ 7732 "view", 7733 "embed", 7734 "edit" 7735 ], 7736 "default": "view", 7737 "required": false 7738 } 7739 } 7740 }, 7741 { 7742 "methods": [ 7743 "POST", 7744 "PUT", 7745 "PATCH" 7746 ], 7747 "allow_batch": { 7748 "v1": true 7749 }, 7750 "args": { 7751 "id": { 7752 "description": "Unique identifier for the term.", 7753 "type": "integer", 7754 "required": false 7755 }, 7756 "description": { 7757 "description": "HTML description of the term.", 7758 "type": "string", 7759 "required": false 7760 }, 7761 "name": { 7762 "description": "HTML title for the term.", 7763 "type": "string", 7764 "required": false 7765 }, 7766 "slug": { 7767 "description": "An alphanumeric identifier for the term unique to its type.", 7768 "type": "string", 7769 "required": false 7770 }, 7771 "meta": { 7772 "description": "Meta fields.", 7773 "type": "object", 7774 "properties": [], 7775 "required": false 7776 }, 7777 "locations": { 7778 "description": "The locations assigned to the menu.", 7779 "type": "array", 7780 "items": { 7781 "type": "string" 7782 }, 7783 "required": false 7784 }, 7785 "auto_add": { 7786 "description": "Whether to automatically add top level pages to this menu.", 7787 "type": "boolean", 7788 "required": false 7789 } 7790 } 7791 }, 7792 { 7793 "methods": [ 7794 "DELETE" 7795 ], 7796 "allow_batch": { 7797 "v1": true 7798 }, 7799 "args": { 7800 "id": { 7801 "description": "Unique identifier for the term.", 7802 "type": "integer", 7803 "required": false 7804 }, 7805 "force": { 7806 "type": "boolean", 7807 "default": false, 7808 "description": "Required to be true, as terms do not support trashing.", 7809 "required": false 7810 } 7811 } 7812 } 7813 ] 7814 }, 6633 7815 "/wp/v2/users": { 6634 7816 "namespace": "wp/v2", … … 6767 7949 "page": "page", 6768 7950 "attachment": "attachment", 7951 "nav_menu_item": "nav_menu_item", 6769 7952 "wp_block": "wp_block", 6770 7953 "wp_template": "wp_template", … … 9121 10304 ] 9122 10305 } 10306 }, 10307 "/wp/v2/menu-locations": { 10308 "namespace": "wp/v2", 10309 "methods": [ 10310 "GET" 10311 ], 10312 "endpoints": [ 10313 { 10314 "methods": [ 10315 "GET" 10316 ], 10317 "args": { 10318 "context": { 10319 "description": "Scope under which the request is made; determines fields present in response.", 10320 "type": "string", 10321 "enum": [ 10322 "view", 10323 "embed", 10324 "edit" 10325 ], 10326 "default": "view", 10327 "required": false 10328 } 10329 } 10330 } 10331 ], 10332 "_links": { 10333 "self": [ 10334 { 10335 "href": "http://example.org/index.php?rest_route=/wp/v2/menu-locations" 10336 } 10337 ] 10338 } 10339 }, 10340 "/wp/v2/menu-locations/(?P<location>[\\w-]+)": { 10341 "namespace": "wp/v2", 10342 "methods": [ 10343 "GET" 10344 ], 10345 "endpoints": [ 10346 { 10347 "methods": [ 10348 "GET" 10349 ], 10350 "args": { 10351 "location": { 10352 "description": "An alphanumeric identifier for the menu location.", 10353 "type": "string", 10354 "required": false 10355 }, 10356 "context": { 10357 "description": "Scope under which the request is made; determines fields present in response.", 10358 "type": "string", 10359 "enum": [ 10360 "view", 10361 "embed", 10362 "edit" 10363 ], 10364 "default": "view", 10365 "required": false 10366 } 10367 } 10368 } 10369 ] 9123 10370 } 9124 10371 }, … … 9996 11243 } 9997 11244 }, 11245 "nav_menu_item": { 11246 "description": "", 11247 "hierarchical": false, 11248 "name": "Navigation Menu Items", 11249 "slug": "nav_menu_item", 11250 "taxonomies": [ 11251 "nav_menu" 11252 ], 11253 "rest_base": "menu-items", 11254 "rest_namespace": "wp/v2", 11255 "_links": { 11256 "collection": [ 11257 { 11258 "href": "http://example.org/index.php?rest_route=/wp/v2/types" 11259 } 11260 ], 11261 "wp:items": [ 11262 { 11263 "href": "http://example.org/index.php?rest_route=/wp/v2/menu-items" 11264 } 11265 ], 11266 "curies": [ 11267 { 11268 "name": "wp", 11269 "href": "https://api.w.org/{rel}", 11270 "templated": true 11271 } 11272 ] 11273 } 11274 }, 9998 11275 "wp_block": { 9999 11276 "description": "", … … 10268 11545 { 10269 11546 "href": "http://example.org/index.php?rest_route=/wp/v2/tags" 11547 } 11548 ], 11549 "curies": [ 11550 { 11551 "name": "wp", 11552 "href": "https://api.w.org/{rel}", 11553 "templated": true 11554 } 11555 ] 11556 } 11557 }, 11558 "nav_menu": { 11559 "name": "Navigation Menus", 11560 "slug": "nav_menu", 11561 "description": "", 11562 "types": [ 11563 "nav_menu_item" 11564 ], 11565 "hierarchical": false, 11566 "rest_base": "menus", 11567 "rest_namespace": "wp/v2", 11568 "_links": { 11569 "collection": [ 11570 { 11571 "href": "http://example.org/index.php?rest_route=/wp/v2/taxonomies" 11572 } 11573 ], 11574 "wp:items": [ 11575 { 11576 "href": "http://example.org/index.php?rest_route=/wp/v2/menus" 10270 11577 } 10271 11578 ],
Note: See TracChangeset
for help on using the changeset viewer.