Skip to content

Commit 65c3a8e

Browse files
committed
HTML API: Make WP_HTML_Processor::serialize_token() public.
Trac ticket: Core-63823 Follows #7331 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. Follow-up to [[59076]](https://core.trac.wordpress.org/changeset/59076).
1 parent 8db4b46 commit 65c3a8e

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)