[wp-trac] [WordPress Trac] #59443: Block Supports: Re-use instance of Tag Processor when adding layout classes

WordPress Trac noreply at wordpress.org
Thu Oct 5 11:12:03 UTC 2023


#59443: Block Supports: Re-use instance of Tag Processor when adding layout classes
---------------------------------------+----------------------------
 Reporter:  dmsnell                    |       Owner:  isabel_brison
     Type:  enhancement                |      Status:  reopened
 Priority:  normal                     |   Milestone:  6.4
Component:  Editor                     |     Version:  trunk
 Severity:  normal                     |  Resolution:
 Keywords:  gutenberg-merge has-patch  |     Focuses:  performance
---------------------------------------+----------------------------

Comment (by spacedmonkey):

 > @spacedmonkey are you referring to do_blocks() here? to which while loop
 are you referring?

 While loop here.
 {{{#!php
                 $first_chunk_processor = new WP_HTML_Tag_Processor(
 $first_chunk );
                 while ( $first_chunk_processor->next_tag() ) {
                         $class_attribute =
 $first_chunk_processor->get_attribute( 'class' );
                         if ( is_string( $class_attribute ) && ! empty(
 $class_attribute ) ) {
                                 $inner_block_wrapper_classes =
 $class_attribute;
                         }
                 }

 }}}

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


More information about the wp-trac mailing list