Query does not display when using filters and navigating directly to page with url param that starts with "term"

Description:

Navigating directing to a page with url parameters specified beginning with “term” causes any Query blocks with filters for those url parameters to fail to display.

Step-by-step reproduction instructions:

  1. Open the Post Editor/Site Editor
  2. Add a Query block
  3. Give it an ID and add a filterable Taxonomy (for example) with a url parameter starting with “term”
  4. Add a Filter block
  5. Connect it to the Query ID and the Taxonomy with the same url parameter
  6. Load the just the page url and observe that it works flawlessly (e.g. https://site.tld/page/)
  7. Load the url with the url parameter already present and observe the Query doesn’t display (e.g. https://site.tld/page/?term-duration=annual)

Screenshots, screen recording, code snippet


Environment info

  • WordPress version: 6.2
  • Gutenberg Plugin version: -
  • Cwicly Plugin version: 1.2.9.5.8.3
  • Cwicly Theme version: 1.0.3

It’s working fine for me. I did notice it would do this for “search”, since I believe it’s reserved by WordPress.

I wonder if something similar could be happening here with “term.”

Does it work if you make the key “_term-duration”?

Indeed it does! Good thinking @sunny.

Changing it to “_term-duration” or “subscription-duration” completely resolves the issue - anything with the word “term” prefixing the query seems to cause it.

1 Like

Awesome! Glad it helped :slight_smile: