Query
Advanced Query Block.
Namespace: WebberZone\Top_Ten\Pro\Blocks
Since: 4.0.0
Source: includes/pro/blocks/class-query.php line 19
Methods
__construct()
Register blocks with WordPress.
Line: 24
public function __construct( );
update_query_loop_rest_params()
Updates the query vars for the Query Loop block in the block editor for the Top 10 Query block.
Since: 4.0.0
Line: 36
public function update_query_loop_rest_params( );
update_rest_query()
Update the query vars for the REST API.
Since: 4.0.0
Line: 53
public function update_rest_query( $args, $request ): array;
| Type | Name | Description |
|---|---|---|
array |
$args |
The query arguments. |
\WP_REST_Request |
$request |
The REST request. |
Returns: array — The updated query arguments.
update_rest_collection_params()
Update the collection params for the REST API.
Since: 4.0.0
Line: 95
public function update_rest_collection_params( $query_params ): array;
| Type | Name | Description |
|---|---|---|
array |
$query_params |
The collection parameters. |
Returns: array — The updated collection parameters.
update_query_loop_query_vars()
Update the front-end query for the Top 10 Query variation.
Since: 4.0.0
Line: 120
public function update_query_loop_query_vars( $query, $block, $page ): array;
| Type | Name | Description |
|---|---|---|
array |
$query |
The query arguments. |
\WP_Block |
$block |
The Query Loop block instance. |
int |
$page |
The current query page. |
Returns: array — The updated query arguments.
parse_meta_query()
Parses meta query data into a \WP_Query-ready meta_query array.
Since: 4.0.0
Line: 167
public function parse_meta_query( $meta_query_data ): array;
| Type | Name | Description |
|---|---|---|
mixed |
$meta_query_data |
The meta query data to parse. |
Returns: array — The parsed meta queries.
enqueue_block_editor_assets() static
Enqueue scripts and styles for the block editor.
Since: 4.0.0
Line: 213
static public function enqueue_block_editor_assets( );
register_block_patterns()
Register block patterns.
Since: 4.0.0
Line: 238
public function register_block_patterns( );