Abstract_Block
Abstract class for blocks.
Tags
Table of Contents
- $block : WP_Block
- The block class.
- $block_name : string
- The block name.
- $namespace : string
- Block namespace.
- $plugin : Plugin
- Plugin.
- __construct() : mixed
- Constructor.
- enqueue_assets() : void
- Enqueue block assets.
- register_block() : void
- Registers the block.
- render() : string|void
- Render the block via PHP.
- get_block_json_path() : string
- Get the block JSON path.
Properties
$block
The block class.
protected
WP_Block
$block
Tags
$block_name
The block name.
protected
string
$block_name
= ''
Tags
$namespace
Block namespace.
protected
string
$namespace
= 'document-library-pro'
Tags
$plugin
Plugin.
private
Plugin
$plugin
Tags
Methods
__construct()
Constructor.
public
__construct(Plugin $plugin) : mixed
Parameters
- $plugin : Plugin
-
The plugin.
Tags
Return values
mixed —enqueue_assets()
Enqueue block assets.
public
enqueue_assets() : void
Tags
Return values
void —register_block()
Registers the block.
public
register_block() : void
Tags
Return values
void —render()
Render the block via PHP.
public
render(array<string|int, mixed> $attributes, string $content, WP_Block $block) : string|void
Parameters
- $attributes : array<string|int, mixed>
-
Block attributes.
- $content : string
-
Block content.
- $block : WP_Block
-
Block class.
Tags
Return values
string|void —get_block_json_path()
Get the block JSON path.
protected
get_block_json_path() : string