Recent

Blocks class

Blocks

Blocks class.

Namespace: WebberZone\Top_Ten\Frontend\Blocks
Since: 3.3.0
Source: includes/frontend/blocks/class-blocks.php line 24

Methods

__construct()

Register blocks with WordPress.

Line: 29

public function __construct(  );

register_blocks()

Registers the block using the metadata loaded from the block.json file. Behind the scenes, it registers also all assets so they can be enqueued through the block editor in the corresponding context.

Since: 3.1.0
Line: 42

public function register_blocks(  );

Renders the top-10/popular-posts block on server.

Since: 3.0.0
Line: 85

static public function render_block_popular_posts( $attributes ): string;
TypeNameDescription
array$attributesThe block attributes.

Returns: string — Returns the post content with popular posts added.

render_block_post_count() static

Renders the core/post-title block on the server.

Since: 4.0.0
Line: 150

static public function render_block_post_count( $attributes, $content, $block ): string;
TypeNameDescription
array$attributesBlock attributes.
string$contentBlock default content.
\WP_Block$blockBlock instance.

Returns: string — Returns the post count.

enqueue_block_editor_assets() static

Enqueue scripts and styles for the block editor.

Since: 3.1.0
Line: 441

static public function enqueue_block_editor_assets(  );

add_custom_preload_paths() static

Add custom preload paths for the REST API.

Since: 4.0.0
Line: 478

static public function add_custom_preload_paths( $preload_paths ): array;
TypeNameDescription
array$preload_pathsExisting preload paths.

Returns: array — Modified preload paths.