Skip to content

Commit 2191d04

Browse files
committed
HTML API: Make WP_HTML_Processor::serialize_token() public.
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 WordPress/wordpress-develop#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
1 parent 090fb72 commit 2191d04

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

wp-includes/html-api/class-wp-html-processor.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1304,10 +1304,11 @@ public function serialize(): ?string {
13041304
* @see static::serialize()
13051305
*
13061306
* @since 6.7.0
1307+
* @since 6.9.0 Converted from protected to public method.
13071308
*
13081309
* @return string Serialization of token, or empty string if no serialization exists.
13091310
*/
1310-
protected function serialize_token(): string {
1311+
public function serialize_token(): string {
13111312
$html = '';
13121313
$token_type = $this->get_token_type();
13131314

wp-includes/version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* @global string $wp_version
1818
*/
19-
$wp_version = '6.9-alpha-60632';
19+
$wp_version = '6.9-alpha-60633';
2020

2121
/**
2222
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

0 commit comments

Comments
 (0)