Skip to content

Schema output at bottom of file #779

@jhmonroe

Description

@jhmonroe

I noticed that when exporting a theme via this plugin, it places the schema and version at bottom of theme.json in this order:
settings, styles, etc...
"version": 3,
"$schema": "https://schemas.wp.org/wp/6.8/theme.json"
}

This creates problems in IDE such as VSCode since the tooltips only work if the Schema is at the top of the file (tooltips weren't working for me until I switched to the following:

SCHEME
VERSION
settings... etc

Making sure the plugin always outputs in this order will ensure expected behavior

I noticed examples such as this (https://make.wordpress.org/themes/2021/11/30/theme-json-schema/) also always show it at the top and they show working tooltips

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions