Skip to content

Duplicate post format taxonomy query in Gutenberg 19.4.0 when run on WordPress 6.7 beta #66071

@david-binda

Description

@david-binda

Description

WordPress 6.7 is going to contain the support for post formats in Query Block & Posts API ( see https://core.trac.wordpress.org/changeset/59115/ ).

Gutenberg currently has the gutenberg_add_format_query_vars_to_query_loop_block function which is backporting the same behaviour when run on WordPress < 6.7, but when run on WordPress 6.7 the gutenberg_add_format_query_vars_to_query_loop_block actually duplicates the taxonomy query in the WP_Query's query arguments produced by the build_query_vars_from_query_block function.

IMHO, we should not introduce the same taxonomy query in case it's already handled by WordPress itself.

Step-by-step reproduction instructions

  1. Have WordPress 6.7 (beta) installed
  2. Have Gutenberg 19.4.0 installed
  3. run the build_query_vars_from_query_block with same params as used in the related PHPUnit tests ( see https://core.trac.wordpress.org/changeset/59115/ ) and observe the duplicate taxonomy query entry.

Screenshots, screen recording, code snippet

No response

Environment info

  • WordPress 6.7 beta
  • Gutenberg 19.4.0

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions