Skip to content

Commit

Permalink
New properties and REST fields for 6.5.
Browse files Browse the repository at this point in the history
  • Loading branch information
johnbillion committed Mar 9, 2024
1 parent e65bc19 commit 354aa5f
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 0 deletions.
32 changes: 32 additions & 0 deletions packages/wp-types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,22 @@ export interface WP_Block_Type {
| {
[k: string]: string;
};
/**
* Allowed child block types.
*/
allowed_blocks: string[] | null;
/**
* Block variations callback.
*/
variation_callback: Callable | null;
/**
* Block type front end only script module IDs.
*/
view_script_module_ids: string[];
/**
* Block type front end only style handles.
*/
view_style_handles: string[];
/**
* Custom CSS selectors for theme.json style generation.
*/
Expand Down Expand Up @@ -2098,6 +2114,10 @@ export interface WP_REST_API_Attachment {
* Unique identifier for the attachment.
*/
id: number;
/**
* The ID of the featured media for the post.
*/
featured_media: number;
/**
* URL to the attachment.
*/
Expand Down Expand Up @@ -2631,6 +2651,18 @@ export interface WP_REST_API_Block_Type {
| {
[k: string]: string;
};
/**
* Allowed child block types.
*/
allowed_blocks: string[] | null;
/**
* Block type front end only script module IDs.
*/
view_script_module_ids: string[];
/**
* Block type front end only style handles.
*/
view_style_handles: string[];
/**
* Public text domain.
*/
Expand Down
39 changes: 39 additions & 0 deletions schemas/block-type.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
"attributes",
"uses_context",
"block_hooks",
"allowed_blocks",
"variation_callback",
"view_script_module_ids",
"view_style_handles",
"provides_context",
"editor_script_handles",
"script_handles",
Expand Down Expand Up @@ -116,6 +120,41 @@
}
]
},
"allowed_blocks": {
"description": "Allowed child block types.",
"type": [
"array",
"null"
],
"items": {
"type": "string"
}
},
"variation_callback": {
"description": "Block variations callback.",
"anyOf": [
{
"$ref": "properties/callable.json"
},
{
"type": "null"
}
]
},
"view_script_module_ids": {
"description": "Block type front end only script module IDs.",
"type": "array",
"items": {
"type": "string"
}
},
"view_style_handles": {
"description": "Block type front end only style handles.",
"type": "array",
"items": {
"type": "string"
}
},
"selectors": {
"description": "Custom CSS selectors for theme.json style generation.",
"oneOf": [
Expand Down
5 changes: 5 additions & 0 deletions schemas/rest-api/attachment.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"date_gmt",
"guid",
"id",
"featured_media",
"link",
"modified",
"modified_gmt",
Expand Down Expand Up @@ -74,6 +75,10 @@
"description": "Unique identifier for the attachment.",
"type": "integer"
},
"featured_media": {
"description": "The ID of the featured media for the post.",
"type": "integer"
},
"link": {
"readOnly": true,
"description": "URL to the attachment.",
Expand Down
27 changes: 27 additions & 0 deletions schemas/rest-api/block-type.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
"styles",
"variations",
"block_hooks",
"allowed_blocks",
"view_script_module_ids",
"view_style_handles",
"textdomain",
"parent",
"keywords",
Expand Down Expand Up @@ -262,6 +265,30 @@
}
]
},
"allowed_blocks": {
"description": "Allowed child block types.",
"type": [
"array",
"null"
],
"items": {
"type": "string"
}
},
"view_script_module_ids": {
"description": "Block type front end only script module IDs.",
"type": "array",
"items": {
"type": "string"
}
},
"view_style_handles": {
"description": "Block type front end only style handles.",
"type": "array",
"items": {
"type": "string"
}
},
"textdomain": {
"description": "Public text domain.",
"type": [
Expand Down

0 comments on commit 354aa5f

Please sign in to comment.