Skip to content

Auto-generate enhanced pagination queryIDs if not specified in the markup. #55747

@peterwilsoncc

Description

@peterwilsoncc

What problem does this address?

In #55719 enhanced pagination of the Query block was prevented if the queryId parameter was not set. This was to prevent a PHP notice in the event a distributed theme file contained incorrect markup.

This was suitable as a fast-follow to allow a fix to get in to WordPress 6.4 during the RC phase.

Ideally, a queryId would be auto-generated in the circumstance so themes could respect the theme developer's intent to enable enhanced pagination.

What is your proposed solution?

Autogenerate Query IDs if none is provided by the developer:

  • ensure the ID does not clash with other queryIDs on the page
  • ensure the ID is generated consistently from one page load to another (maybe via a hash of the attributes and inner content or by filtering the generated json data)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions