[wp-trac] [WordPress Trac] #59681: Regression: Fix layout support to be compatible with enhanced pagination

WordPress Trac noreply at wordpress.org
Tue Oct 24 09:02:19 UTC 2023


#59681: Regression: Fix layout support to be compatible with enhanced pagination
-------------------------------------------------+-------------------------
 Reporter:  luisherranz                          |       Owner:
                                                 |  hellofromTonya
     Type:  defect (bug)                         |      Status:  closed
 Priority:  normal                               |   Milestone:  6.4
Component:  Editor                               |     Version:
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  gutenberg-merge has-patch has-unit-  |     Focuses:
  tests commit dev-reviewed                      |
-------------------------------------------------+-------------------------
Changes (by Bernhard Reiter):

 * status:  reopened => closed
 * resolution:   => fixed


Comment:

 In [changeset:"56995" 56995]:
 {{{
 #!CommitTicketReference repository="" revision="56995"
 Blocks: Fix layout support to be compatible with enhanced pagination.

 Make layout support compatible with enhanced pagination by ensuring that
 generated class names are stable across pagination, even when the number
 of rendered posts is different.

 With the previous implementation of enhanced pagination, the CSS
 corresponding to each block was not detected. Therefore, for enhanced
 pagination to work correctly, the CSS of the blocks present in the Post
 Template must be stable on all pages.

 The number of posts rendered by the Query block is always the same, except
 in the last page, where it can be only a fraction. If any of the blocks
 rendered by the Post Template used the `wp_unique_id` function, the ID
 (which is incremental) would have been different than in the previous
 pages and the class names would have varied.

 This is remediated by this changeset by replacing the usage of
 `wp_unique_id` in the layout support (which is used by the Query block)
 with an implementation that uses IDs that are incremental only for that
 block. That way, the generated class names are never affected by the
 number of times `wp_unique_id` runs.

 Props luisherranz, andrewserong, isabel_brison, costdev, mukesh27,
 cbravobernal, hellofromTonya, jorbin.
 Merges [56994] to the 6.4 branch.
 Fixes #59681.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/59681#comment:19>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list