Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion lib/experimental/html/class-wp-html-tag-processor.php
Original file line number Diff line number Diff line change
Expand Up @@ -1221,13 +1221,24 @@ public function remove_class( $class_name ) {

/**
* Returns the string representation of the HTML Tag Processor.
* It closes the HTML Tag Processor and prevents further lookups and modifications.
*
* @since 6.2.0
* @see get_updated_html
*
* @return string The processed HTML.
*/
public function __toString() {
return $this->get_updated_html();
}

/**
* Returns the string representation of the HTML Tag Processor.
*
* @since 6.2.0
*
* @return string The processed HTML.
*/
public function get_updated_html() {
// Short-circuit if there are no updates to apply.
if ( ! count( $this->classname_updates ) && ! count( $this->attribute_updates ) ) {
return $this->updated_html . substr( $this->html, $this->updated_bytes );
Expand Down
Loading