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

View File

@ -1,4 +1,5 @@
{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 2,
"customTemplates": [
{

View File

@ -1,4 +1,5 @@
{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 2,
"settings": {
"appearanceTools": false,

View File

@ -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": {

View File

@ -1,4 +1,5 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"name": "tests/notice",
"title": "Notice",

View File

@ -1,4 +1,5 @@
{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 1,
"settings": {
"color": {

View File

@ -1,4 +1,5 @@
{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 2,
"settings": {
"appearanceTools": true,

View File

@ -1,4 +1,5 @@
{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 2,
"settings": {
"appearanceTools": true,

View File

@ -1,4 +1,5 @@
{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 2,
"settings": {
"appearanceTools": true,

View File

@ -1,4 +1,5 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"title": "Example Theme Block",
"name": "block-theme/example-block",

View File

@ -1,4 +1,5 @@
{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 1,
"settings": {
"color": {

View File

@ -1,4 +1,5 @@
{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 1,
"settings": {
"color": {

View File

@ -1,4 +1,5 @@
{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 1,
"settings": {
"color": {

View File

@ -1,4 +1,5 @@
{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 1,
"title": "Block theme",
"settings": {

View File

@ -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"

View File

@ -1,4 +1,6 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"title": "Hooked Block (before)",
"name": "tests/hooked-before",
"blockHooks": {
"core/navigation": "before"

View File

@ -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"

View File

@ -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"

View File

@ -1,4 +1,5 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"title": "Example Theme Block",
"name": "block-theme/example-block",

View File

@ -1,4 +1,5 @@
{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 1,
"title": "Block theme",
"settings": {

View File

@ -1,4 +1,5 @@
{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 1,
"settings": {
"color": {

View File

@ -1,4 +1,5 @@
{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 2,
"customTemplates": [
{

View File

@ -1,4 +1,5 @@
{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 2,
"settings": {
"appearanceTools": true,

View File

@ -1,4 +1,5 @@
{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 1,
"settings": {
"color": {