Editor extends Component

Implements integration with Gutenberg.

Table of Contents

$blocks  : array<string|int, mixed>
Registered blocks.
$context  : array<string|int, mixed>
Template context.
$template  : array<string|int, mixed>
Template blocks.
__call()  : string
Catches calls to undefined methods.
__construct()  : mixed
Class constructor.
enqueue_editor_styles()  : mixed
Enqueues editor styles.
init_template_editor()  : mixed
Initializes template editor.
is_preview()  : bool
Checks if editor preview mode is enabled.
register_block_categories()  : array<string|int, mixed>
Registers block categories.
register_default_blocks()  : mixed
Registers default blocks.
register_template_blocks()  : object
Registers template blocks.
boot()  : mixed
Bootstraps component properties.
get_block()  : array<string|int, mixed>
Gets block arguments.
get_template_blocks()  : array<string|int, mixed>
Gets template blocks.
is_block_preview()  : bool
Checks if block preview mode is enabled.
register_block()  : mixed
Registers block type.
set_callbacks()  : mixed
Sets the action and filter callbacks.
set_property()  : mixed
Sets a property value.

Properties

Methods

__call()

Catches calls to undefined methods.

public __call(string $name, array<string|int, mixed> $args) : string
Parameters
$name : string

Method name.

$args : array<string|int, mixed>

Method arguments.

Tags
throws
BadMethodCallException

Invalid method.

Return values
string

__construct()

Class constructor.

public __construct([array<string|int, mixed> $args = [] ]) : mixed
Parameters
$args : array<string|int, mixed> = []

Component arguments.

Return values
mixed

register_block_categories()

Registers block categories.

public register_block_categories(array<string|int, mixed> $categories) : array<string|int, mixed>
Parameters
$categories : array<string|int, mixed>

Block categories.

Return values
array<string|int, mixed>

register_template_blocks()

Registers template blocks.

public register_template_blocks(string $name[, array<string|int, mixed> $args = [] ]) : object
Parameters
$name : string

Template name.

$args : array<string|int, mixed> = []

Template arguments.

Return values
object

get_block()

Gets block arguments.

protected get_block(string $type[, string $name = null ][, array<string|int, mixed> $args = [] ]) : array<string|int, mixed>
Parameters
$type : string

Block type.

$name : string = null

Block name.

$args : array<string|int, mixed> = []

Template arguments.

Return values
array<string|int, mixed>

get_template_blocks()

Gets template blocks.

protected get_template_blocks(array<string|int, mixed> $template) : array<string|int, mixed>
Parameters
$template : array<string|int, mixed>

Template arguments.

Return values
array<string|int, mixed>

register_block()

Registers block type.

protected register_block(string $type, array<string|int, mixed> $args) : mixed
Parameters
$type : string

Block type.

$args : array<string|int, mixed>

Block arguments.

Return values
mixed

set_callbacks()

Sets the action and filter callbacks.

protected final set_callbacks(array<string|int, mixed> $callbacks) : mixed
Parameters
$callbacks : array<string|int, mixed>

Callback arguments.

Return values
mixed

set_property()

Sets a property value.

protected final set_property(string $name, mixed $value[, string $prefix = '' ]) : mixed
Parameters
$name : string

Property name.

$value : mixed

Property value.

$prefix : string = ''

Method prefix.

Return values
mixed