alleyinteractive / alleyinteractive/wp-match-blocks

Make it possible to query by attributes via key-value pairs

未关闭
#21 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
PHP
星标
9
派生
0
PR 合并指标
30 天内没有已合并 PR

描述

### Description

Before:

```
$blocks = \Alley\WP\match_blocks(
$post,
[
'attrs' => [
[
'key' => 'align',
'value' => 'right',
],
],
'name' => 'core/paragraph',
]
);
```

After:

```
$blocks = \Alley\WP\match_blocks(
$post,
[
'attrs' => [
'align' => 'right',
],
'name' => 'core/paragraph',
],
);
```

### Use Case

The reason that this syntax isn't supported is so that the `attrs` parameter behaves like `meta_query`, `tax_query`, etc. I still like that consistency, but I also still get annoyed at having to write the whole thing out, so maybe the consistency isn't worth it.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。