Set Defaults for AREOI blocks in my theme’s theme.json

[ad_1]

Not sure if I am doing this correctly, but I wanted to set the defaults for a few of this plugin’s blocks in my theme.json.

I know I can do that for core blocks like this:

{
  "version": 2,
  "$schema": "https://schemas.wp.org/trunk/theme.json",
  "settings": {
    "appearanceTools": true,
    "border": {
      ...
    },
    "color": {
      ...
    },
    "layout": {
      "contentSize": "1600px",
      "wideSize": "100%"
    },
    "spacing": {
      ...
    },
    "typography": {
      ...
    },
    "blocks": {
      "core/heading": {
        "color": {
          "text": true,
          "background": false,
          "link": false,
          "palette": [
            {
              "color": "#ffffff",
              "slug": "white",
              "name": "White"
            }, 
            {
              "color": "#4f99bb",
              "slug": "blue",
              "name": "#4f99bb - Blue"
            }
          ]
        },
        "typography": {
					"fontFamily": "var(--wp--preset--font-family--MINE)"
				}
      }
    }
  },

However, when I try to add in the areoi/container block like this (under “blocks”)

      "areoi/container": {
        "attributes": {
          "container": {
            "type": "string",
            "default": "container-xl"
          }
        }
      }

It doesn’t work.

Note: When I edit the default value in the blocks/container/block.json, it does work.

Am I going about this the wrong way? Is there a PHP function instead to override the default value for this or any other block in this plugin?

Thanks in advance!

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer