General: Add $schema property to block and theme JSON files.

Additionally, this changeset fixes some of the `block.json` and `theme.json` files in PHPUnit tests by adding missing `title` properties to satisfy the schema. Those changes have no impact on the runtime whatsoever and do not change the result of unit tests.

Note that some block and theme JSON files still aren't valid according to the schema. Fixing is underway; the required changes will be merged subsequently.

Props jonsurrell, dmsnell, gziolo.
Fixes #60255.

git-svn-id: https://develop.svn.wordpress.org/trunk@57336 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
bernhard-reiter
2024-01-23 13:05:08 +00:00
parent 3bf2b25343
commit de0c4028c7
23 changed files with 27 additions and 0 deletions
@@ -1,4 +1,5 @@
{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 2,
"customTemplates": [
{
+1
View File
@@ -1,4 +1,5 @@
{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 2,
"settings": {
"appearanceTools": false,
@@ -1,4 +1,5 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"name": "tests/hooked-block-error",
"description": "A block that throws an error because it tries to hook a block to itself.",
"blockHooks": {
@@ -1,4 +1,5 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"name": "tests/notice",
"title": "Notice",
@@ -1,4 +1,5 @@
{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 1,
"settings": {
"color": {
@@ -1,4 +1,5 @@
{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 2,
"settings": {
"appearanceTools": true,
@@ -1,4 +1,5 @@
{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 2,
"settings": {
"appearanceTools": true,
@@ -1,4 +1,5 @@
{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 2,
"settings": {
"appearanceTools": true,
@@ -1,4 +1,5 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"title": "Example Theme Block",
"name": "block-theme/example-block",
@@ -1,4 +1,5 @@
{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 1,
"settings": {
"color": {
@@ -1,4 +1,5 @@
{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 1,
"settings": {
"color": {
@@ -1,4 +1,5 @@
{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 1,
"settings": {
"color": {
@@ -1,4 +1,5 @@
{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 1,
"title": "Block theme",
"settings": {
@@ -1,4 +1,6 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"title": "Hooked Block (after)",
"name": "tests/hooked-after",
"blockHooks": {
"core/post-content": "after"
@@ -1,4 +1,6 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"title": "Hooked Block (before)",
"name": "tests/hooked-before",
"blockHooks": {
"core/navigation": "before"
@@ -1,4 +1,6 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"title": "Hooked Block (first child)",
"name": "tests/hooked-first-child",
"blockHooks": {
"core/comments": "firstChild"
@@ -1,4 +1,6 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"title": "Hooked Block (last child)",
"name": "tests/hooked-last-child",
"blockHooks": {
"core/comment-template": "lastChild"
@@ -1,4 +1,5 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"title": "Example Theme Block",
"name": "block-theme/example-block",
@@ -1,4 +1,5 @@
{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 1,
"title": "Block theme",
"settings": {
@@ -1,4 +1,5 @@
{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 1,
"settings": {
"color": {
@@ -1,4 +1,5 @@
{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 2,
"customTemplates": [
{
@@ -1,4 +1,5 @@
{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 2,
"settings": {
"appearanceTools": true,
@@ -1,4 +1,5 @@
{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 1,
"settings": {
"color": {