From 2191d0443caa32f736d54918e76343d1f00d60c1 Mon Sep 17 00:00:00 2001 From: dmsnell Date: Wed, 13 Aug 2025 17:58:28 +0000 Subject: [PATCH] HTML API: Make WP_HTML_Processor::serialize_token() public. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The serialize_token() method was added in WordPress 6.7.0 as a protected member on the WP_HTML_Processor class. It wasn’t clear at the time of merging if it would be necessary to expose it as a public method. However, since that time a number of experiments have led to the conclusion that it would be very valuable to do so. This patch opens up the method for invocation from the outside, trivializing the generation of normative HTML subspans from a parent document. Developed in https://github.com/WordPress/wordpress-develop/pull/9456 Discussed in https://core.trac.wordpress.org/ticket/63823 Follow-up to [59076]. Props dmsnell, jonsurrell. Fixes #38044. Built from https://develop.svn.wordpress.org/trunk@60633 git-svn-id: http://core.svn.wordpress.org/trunk@59969 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/html-api/class-wp-html-processor.php | 3 ++- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/wp-includes/html-api/class-wp-html-processor.php b/wp-includes/html-api/class-wp-html-processor.php index ba03ff44d7..67bccab7b3 100644 --- a/wp-includes/html-api/class-wp-html-processor.php +++ b/wp-includes/html-api/class-wp-html-processor.php @@ -1304,10 +1304,11 @@ class WP_HTML_Processor extends WP_HTML_Tag_Processor { * @see static::serialize() * * @since 6.7.0 + * @since 6.9.0 Converted from protected to public method. * * @return string Serialization of token, or empty string if no serialization exists. */ - protected function serialize_token(): string { + public function serialize_token(): string { $html = ''; $token_type = $this->get_token_type(); diff --git a/wp-includes/version.php b/wp-includes/version.php index 6f1582113c..8efdd52843 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.9-alpha-60632'; +$wp_version = '6.9-alpha-60633'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.