mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Follow-up #54337, [52069]. Part of https://github.com/WordPress/gutenberg/issues/41236. More details in https://github.com/WordPress/gutenberg/issues/33542. Allow passing more than one script per block for `editorScript`, `script`, and `viewScript` fields in the `block.json` metadata file. This aligns with the previously added changes for `style` and `editorStyle` fields. This change impacts the `WP_Block_Type` class and the REST API endpoint for block types. To ensure backward compatibiliy old names were soft deprecated in favor of new fields that work with array values and have `_handles` suffix. Props zieladam, dlh, timothyblynjacobs, aristath, bernhard-reiter. Fixes #56408. git-svn-id: https://develop.svn.wordpress.org/trunk@54155 602fd350-edb4-49c9-b593-d223f7449a82
65 lines
1.1 KiB
JSON
65 lines
1.1 KiB
JSON
{
|
|
"apiVersion": 2,
|
|
"name": "tests/notice",
|
|
"title": "Notice",
|
|
"category": "common",
|
|
"parent": [
|
|
"tests/group"
|
|
],
|
|
"ancestor": [
|
|
"tests/section"
|
|
],
|
|
"providesContext": {
|
|
"tests/message": "message"
|
|
},
|
|
"usesContext": [
|
|
"groupId"
|
|
],
|
|
"icon": "star",
|
|
"description": "Shows warning, error or success notices…",
|
|
"keywords": [
|
|
"alert",
|
|
"message"
|
|
],
|
|
"textdomain": "notice",
|
|
"attributes": {
|
|
"message": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"supports": {
|
|
"align": true,
|
|
"lightBlockWrapper": true
|
|
},
|
|
"styles": [
|
|
{
|
|
"name": "default",
|
|
"label": "Default",
|
|
"isDefault": true
|
|
},
|
|
{
|
|
"name": "other",
|
|
"label": "Other"
|
|
}
|
|
],
|
|
"variations": [
|
|
{
|
|
"name": "error",
|
|
"title": "Error",
|
|
"description": "Shows error.",
|
|
"keywords": [ "failure" ]
|
|
}
|
|
],
|
|
"example": {
|
|
"attributes": {
|
|
"message": "This is a notice!"
|
|
}
|
|
},
|
|
"editorScript": "tests-notice-editor-script",
|
|
"script": "tests-notice-script",
|
|
"viewScript": [ "tests-notice-view-script", "tests-notice-view-script-2" ],
|
|
"editorStyle": "tests-notice-editor-style",
|
|
"style": [ "tests-notice-style", "tests-notice-style-2" ],
|
|
"render": "file:./render.php"
|
|
}
|