Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/imath/wp-query-block-attributes

Introduce a new WP_Query parameter to run block attributes queries.
https://github.com/imath/wp-query-block-attributes

wordpress-plugin

Last synced: 24 days ago
JSON representation

Introduce a new WP_Query parameter to run block attributes queries.

Awesome Lists containing this project

README

        

# WP Query Block Attributes

Introduce a new WP_Query parameter to run block attributes queries. Here's an example of use:

```php
$q = new WP_Query();
$items = $q->query(
array(
'post_type' => 'post',
array(
'block_attribute_query' => array(
array(
'block' => 'wpqba/block', // Name of the WP Block.
'attribute' => 'wpqbaAttributeOne', // Name of the WP Block attribute.
'value' => 'One', // Value to find.
'type' => 'string', // Type for the value (string or integer).
),
),
,)
)
);
```