Make WordPress Core

Changes between Version 3 and Version 4 of Ticket #57642


Ignore:
Timestamp:
02/06/2023 02:48:10 PM (18 months ago)
Author:
hellofromTonya
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #57642

    • Property Keywords has-unit-tests added
    • Property Milestone changed from Awaiting Review to 6.2
    • Property Summary changed from Backport updates to `wp_render_elements_support` to use html API to Updates `wp_render_elements_support()` to use the HTML API
  • Ticket #57642 – Description

    v3 v4  
    1 We need to update `wp_render_elements_support` to use the new html API (`WP_HTML_Tag_Processor`).
     1Replaces the RegEx and PHP string functionality in `wp_render_elements_support()` to use the new HTML API (`WP_HTML_Tag_Processor`).
    22
    3 Related GB PR: https://github.com/WordPress/gutenberg/pull/46625
     3Why?
     4
     5>This class was built to quickly and reliably modify HTML tag attributes. It circumvents specific problems, such as matching on the wrong attributes (such as data-custom-class="some value"), overlooking matches (such as class=blue or class='wp-block-group'), writing updates in a way that get overlooked by the browser (by writing to the end of the tag instead of before any potential duplicate attributes), and by writing invalid content to the HTML (such as through a bug in a PCRE pattern greedily matching more than it should).
     6
     7Reference:
     8* [https://github.com/WordPress/gutenberg/pull/46625 Gutenberg PR 46625]