Recent

BlocksclassPro only

Blocks

Class to register Pro-only Gutenberg blocks.

Namespace: WebberZone\Knowledge_Base\Pro\Blocks
Since: 3.0.0
Source: includes/pro/blocks/class-blocks.php line 24

Methods

__construct()

Constructor - hook filters to extend the free registrar.

Line: 28

public function __construct(  );

register_pro_blocks()

Add Pro blocks to the registry.

Line: 40

public function register_pro_blocks( $blocks ): array;
Type Name Description
array $blocks Existing blocks.

Returns: array — Modified blocks.

filter_block_metadata_path()

Override metadata path for Pro blocks.

Line: 54

public function filter_block_metadata_path( $path, $block_name ): string;
Type Name Description
string $path Default path.
string $block_name Block slug.

Returns: string — New path for Pro blocks.

filter_block_render_callback()

Override render callback for Pro blocks if needed.

Line: 73

public function filter_block_render_callback( $callback, $block_name ): callable;
Type Name Description
callable $callback Default callback.
string $block_name Block slug.

Returns: callable — Callback.

render_rating_block()

Render callback for Rating block (Pro).

Line: 91

public function render_rating_block( $attributes ): string;
Type Name Description
array $attributes Attributes from block.

Returns: string — HTML.

render_toc_block()

Render callback for TOC block (Pro).

Reads the current post content, parses headings, and returns the TOC HTML. In the editor / REST preview a placeholder is shown when content is unavailable.

Since: 3.0.0
Line: 225

public function render_toc_block( $attributes ): string;
Type Name Description
array $attributes Block attributes.

Returns: string — HTML.

render_section_tree_block()

Render callback for the Section Tree block (Pro).

Since: 3.1.0
Line: 317

public function render_section_tree_block( $attributes ): string;
Type Name Description
array $attributes Block attributes.

Returns: string — HTML.