Skip to content

Commit 50086eb

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 #9456 Discussed in https://core.trac.wordpress.org/ticket/63823 Follow-up to [59076]. Props dmsnell, jonsurrell. Fixes #38044. git-svn-id: https://develop.svn.wordpress.org/trunk@60633 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 8db4b46 commit 50086eb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/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

0 commit comments

Comments
 (0)