Skip to content

Preserve element styles during Query Loop navigation - #15947

Closed
ArkaPrabhaChowdhury wants to merge 1 commit into
WordPress:trunkfrom
ArkaPrabhaChowdhury:trac-66633-query-scope
Closed

ArkaPrabhaChowdhury wants to merge 1 commit into
WordPress:trunkfrom
ArkaPrabhaChowdhury:trac-66633-query-scope

Conversation

@ArkaPrabhaChowdhury

Copy link
Copy Markdown

See https://core.trac.wordpress.org/ticket/66633

Summary

Generate hash-based element classes and scope their counters to the innermost Query block. This keeps styles on markup outside client-side pagination stable while retaining unique classes for duplicate blocks.

Testing

  • rtk proxy php C:\Users\arkop\wordpress-develop\vendor\phpunit\phpunit\phpunit --configuration phpunit.xml.dist tests/phpunit/tests/block-supports/wpRenderElementsSupport.php (16 tests, 23 assertions)
  • rtk proxy php C:\Users\arkop\wordpress-develop\vendor\phpunit\phpunit\phpunit --configuration phpunit.xml.dist tests/phpunit/tests/block-supports/wpRenderElementsSupportStyles.php (9 tests, 10 assertions)
  • PHPCBF on the three changed PHP files; PHPCS reported no violations.

Use of AI Tools

AI assistance: Yes
Tool(s): Codex
Model(s): GPT-6
Used for: Ticket investigation, implementation, and regression tests; the final diff and local checks were reviewed in the workspace.<!--
Hi there! Thanks for contributing to WordPress!

Pull Requests in this GitHub repository must be linked to a ticket in the WordPress Core Trac instance (https://core.trac.wordpress.org), and are only used for code review. No pull requests will be merged on GitHub.

See the WordPress Handbook page on using PRs for Code Review for more information: https://make.wordpress.org/core/handbook/contribute/git/github-pull-requests-for-code-review/

Do not open pull requests for security vulnerabilities. Please follow the responsible disclosure policy instead: https://make.wordpress.org/core/handbook/testing/reporting-security-vulnerabilities/

If this is your first time contributing, you may also find reviewing these guides first to be helpful:

Trac ticket:

Use of AI Tools


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

@github-actions

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs.

Core Committers: Use this line as a base for the props when committing in SVN:

Props arkaprabhachowdhury.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

@github-actions

Copy link
Copy Markdown

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant