diff --git a/src/wp-includes/html-api/class-wp-html-processor.php b/src/wp-includes/html-api/class-wp-html-processor.php index b2a597b938495..401b322446fae 100644 --- a/src/wp-includes/html-api/class-wp-html-processor.php +++ b/src/wp-includes/html-api/class-wp-html-processor.php @@ -5431,14 +5431,30 @@ public function has_class( $wanted_class ): ?bool { * * This generator function is designed to be used inside a "foreach" loop. * - * Example: - * - * $p = WP_HTML_Processor::create_fragment( "
" ); - * $p->next_tag(); - * foreach ( $p->class_list() as $class_name ) { - * echo "{$class_name} "; - * } - * // Outputs: "free lang-en " + * ```php + * " ); + * $p->next_tag(); + * foreach ( $p->class_list() as $class_name ) { + * var_dump( $class_name ); + * } + * ``` + * ```expected-output + * string(4) "free" + * string(5) "" + * string(7) "lang-en" + * ``` * * @since 6.6.0 Subclassed for the HTML Processor. */