Skip to content

Gutenberg solution #8

@xeux

Description

@xeux

In case anyone needs to add Gutenbergs blocks to the plugin:

  1. Create the folder "Gutenbergs".
  2. Create a file inside: Gutenbergs_Loader.php
  3. Create a file inside: MyGutenberg.php
  4. Change Plugin.php file.

Gutenbergs_Loader.php content:

<?php

namespace VendorName\PluginName\Gutenbergs;
use VendorName\PluginName\Plugin;

class Gutenbergs_Loader extends Plugin
{
	public function __construct()
	{
		new MyGutenberg();
	}
}

MyGutenberg.php content:

<?php

namespace VendorName\PluginName\Gutenbergs;
use VendorName\PluginName\Plugin;
use Carbon_Fields\Block;
use Carbon_Fields\Field;

class MyGutenberg extends Plugin {

  public function __construct() {
CARBON FIELDS BLOCK CODE

  }
}

https://docs.carbonfields.net/learn/containers/gutenberg-blocks.html

Plugin.php content
// Load Gutenbergs new Gutenbergs\Gutenbergs_Loader(); at load_plugin()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions