wordpress-develop/tests
Felix Arntz 5269bf66f4 Editor: Ensure main query loop is entered for singular content in block themes.
Block themes currently lack the means to trigger the main query loop for singular content, since they cannot reasonably use the `core/query` and `core/post-template` blocks which are intended only for displaying a list of posts. So far, the missing main query loop on singular block templates has been worked around by enforcing the loop in certain `core/post-*` blocks, which however causes other bugs.

This changeset ensures that the main query loop is still started for singular block theme templates, by wrapping the entire template into the loop, which will by definition only have a single cycle as it only encompasses a single post. This is currently the most reliable solution, since even if there were blocks to properly trigger the main query loop on singular content, it would be unrealistic to expect all existing block themes to update their templates accordingly. It may be revisited in the future.

Props gziolo, youknowriad, joemcgill, costdev, mukesh27, flixos90.
Fixes #58154.
See #59225, #58027.


git-svn-id: https://develop.svn.wordpress.org/trunk@56507 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-01 17:30:02 +00:00
..
e2e Build/Test Tools: Prevent 404 errors in the E2E tests. 2023-07-11 03:39:39 +00:00
gutenberg Block Editor: Update the Gutenberg branch used to launch Gutenberg e2e tests. 2021-06-01 09:21:36 +00:00
performance Build/Test Tools: Compare results in performance measurement workflow. 2023-09-01 17:24:56 +00:00
phpunit Editor: Ensure main query loop is entered for singular content in block themes. 2023-09-01 17:30:02 +00:00
qunit Editor: load title on navigation fallback. 2023-07-25 06:28:28 +00:00
visual-regression Build/Test Tools: Update some NPM dependencies to the latest versions. 2022-04-08 20:05:03 +00:00