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( );
render_block_popular_posts() static
Renders the top-10/popular-posts block on server.
Since: 3.0.0
Line: 85
static public function render_block_popular_posts( $attributes ): string;
| Type | Name | Description |
|---|---|---|
array | $attributes | The 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;
| Type | Name | Description |
|---|---|---|
array | $attributes | Block attributes. |
string | $content | Block default content. |
\WP_Block | $block | Block 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;
| Type | Name | Description |
|---|---|---|
array | $preload_paths | Existing preload paths. |
Returns: array — Modified preload paths.