Recent

Query class Pro only

Query

Widget to display the overall count.

Namespace: WebberZone\Contextual_Related_Posts\Pro\Blocks
Since: 3.5.0
Source: includes/blocks/class-query.php line 22

Methods

__construct()

Register widget with WordPress.

Line: 27

public function __construct(  );

update_query_loop_rest_params()

Updates the query vars for the Query Loop block in the block editor for the CRP Query block.

Since: 3.5.0
Line: 39

public function update_query_loop_rest_params(  );

update_rest_query()

Update the query vars for the REST API.

Since: 3.5.0
Line: 56

public function update_rest_query( $args, $request ): array;
TypeNameDescription
array$argsThe query arguments.
\WP_REST_Request$requestThe REST request.

Returns: array — The updated query arguments.

update_rest_collection_params()

Update the collection params for the REST API.

Since: 3.5.0
Line: 118

public function update_rest_collection_params( $query_params ): array;
TypeNameDescription
array$query_paramsThe collection parameters.

Returns: array — The updated collection parameters.

pre_render_block()

Pre-render the block.

Since: 3.5.0
Line: 136

public function pre_render_block( $pre_render, $parsed_block ): string;
TypeNameDescription
string$pre_renderThe pre-rendered content.
array$parsed_blockThe block being rendered.

Returns: string — The updated pre-rendered block.

parse_meta_query()

Parses meta query data and prepares it for use in a \WP_Query.

This function accepts an associative array containing meta query information and returns an array of meta queries, each of which is an associative array with keys ‘key’, ‘value’, and ‘compare’. The ‘relation’ key of the returned array is set to the ‘relation’ value of the input array, if it exists. If it doesn’t exist, an empty string is used as a default value. The function filters out any entries in the returned array that are empty or null.

Since: 3.5.0
Line: 219

public function parse_meta_query( $meta_query_data ): array;
TypeNameDescription
array$meta_query_dataThe 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: 3.5.0
Line: 247

static public function enqueue_block_editor_assets(  );

register_block_patterns()

Register block patterns.

Since: 3.5.0
Line: 272

public function register_block_patterns(  );