Skip to content

Removal of "inherit query from template" breaks query loops in the site editor. #66790

@rmorse

Description

@rmorse

Description

It seems that the option "inherit query from template" is missing in 6.7.

From what I can see, the inherit attribute is still there though, and it looks like the logic is that its set to true in the site editor and false in the block editor automatically.

The problem is, we can use query loops in the site editor, that are not intended for archive display.

If I want to show a list of posts in header or footer template for example, this is now forced to be true, meaning it will be forced to connect to the global $wp_query.

I'm not sure if this breaks existing implementations, I assume it would as the attributes would be changed when visiting the site editor and the block attributes are upgraded automatically.

Step-by-step reproduction instructions

  1. Goto the site editor
  2. Edit header template
  3. Add a query loop
  4. Notice there is no possibility to edit the query loop attributes, such as choosing a post type etc.
  5. Visit the frontend, its using the global $wp_query

Screenshots, screen recording, code snippet

chrome_8IZ6zauWHY.mp4

Environment info

Same issue on both 6.7-alpha-59113 and nightly build 6.7-RC3-59353 of WordPress

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

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Status] Needs More InfoFollow-up required in order to be actionable.[Type] BugAn existing feature does not function as intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions