skip to Main Content

I am using block.json in a WordPress theme for each block withhin but the editorScript is referencing the plugins directory and not the theme.

2

Answers


  1. For themes, you should use theme.json, the newly embraced practice for defining properties for the block editor. Part of theme.json provides for individual blocks and the contents are what you are using for block.json. I think block.json should be reserved for use in plugins where it defines the settings of individual blocks. Use theme.json for defining global settings, including blocks, if contained in the theme.

    Login or Signup to reply.
  2. This behaviour was reported as a bug and will be fixed in WordPress version 6.0.

    Github pull request:

    https://github.com/WordPress/wordpress-develop/pull/2494

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search