BUG: Meta filter block isn’t working when added via code.

Open
#4,193 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

  • #4284 by @Sidsector9 — closed without merging

Assessment

This issue has not been assessed yet.

Description

bug
Describe the bug

When calling the Meta Filter block directly in code like this do_blocks( '<!-- wp:elasticpress/facet-meta {"facet":"affiliate","displayCount":true} /-->' ) the block doesn’t work.

It seems the block depends on WP_Widget_Block to fetch the list of meta, so when inserted directly via code, it fails to render properly.

The same issue exists on the Meta Range Filter.

Steps to Reproduce

Add the Meta Filter via code and check if it works

Screenshots, screen recording, code snippet

No response

Environment information

No response

WordPress and ElasticPress information

No response

Code of Conduct
  • I agree to follow this project's Code of Conduct
Dominant language
PHP
Stars
1.3k
Forks
325
Avg merge
2d 11h
Merged PRs (30d)
24

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from 10up/ElasticPress

All issues in 10up/ElasticPress

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.