Blocks

Child_Block
in package

Class to store child block definition.

Table of Contents

Properties

$child_blocks  : array<string|int, Child_Block>
The child block's child blocks.
$fields  : array<string|int, mixed>
The child block's fields.
$icon  : string
Icon for Child block.
$label  : string
The child block's label to be used within the WordPress UI.
$name  : string
The child block's name.
$supports  : array<string|int, mixed>
Allows configuration to supports section of block configuration.
$template  : string
A path to the render template.

Methods

__construct()  : mixed
Data input function.
__get()  : mixed
Function for retrieving read-only properties.

Properties

$child_blocks

The child block's child blocks.

protected array<string|int, Child_Block> $child_blocks = array()

Array of child blocks.

$label

The child block's label to be used within the WordPress UI.

protected string $label = ''

The child block's label.

$name

The child block's name.

protected string $name = ''

The child block's name (must be hyphen separated).

$supports

Allows configuration to supports section of block configuration.

protected array<string|int, mixed> $supports = array()

$template

A path to the render template.

protected string $template = ''

A path to the render template.

Methods

__construct()

Data input function.

public __construct(string $name, string $label[, array<string|int, mixed> $fields = array() ][, string $template = '' ][, array<string|int, Child_Block$child_blocks = array() ][, string $icon = 'block-default' ][, array<string|int, mixed> $supports = array() ]) : mixed
Parameters
$name : string

The child block's name (must be hyphen separated).

$label : string

The child block's label.

$fields : array<string|int, mixed> = array()

An array of field definitions in ACF format.

$template : string = ''

A path to the render template.

$child_blocks : array<string|int, Child_Block> = array()

(Optional) Array of child blocks.

$icon : string = 'block-default'

(Optional) Icon for Child block.

$supports : array<string|int, mixed> = array()

(Optional) Array of supports configuration.

__get()

Function for retrieving read-only properties.

public __get(string $property) : mixed
Parameters
$property : string

The property to retrieve.


        
On this page

Search results