diff --git a/src/wp-includes/html-api/class-wp-html-tag-processor.php b/src/wp-includes/html-api/class-wp-html-tag-processor.php
index 4e4a8e1c5a..9a6b7d8f21 100644
|
a
|
b
|
final class WP_HTML_Tag_Processor {
|
| 1716 | 1716 | * @return string[] List of attribute names. |
| 1717 | 1717 | */ |
| 1718 | 1718 | public function get_attribute_names_with_prefix( $prefix ) { |
| 1719 | | return array_keys( $this->attributes ); |
| | 1719 | $attribute_names = array(); |
| | 1720 | |
| | 1721 | // Include parsed attributes. |
| | 1722 | foreach ( $this->attributes as $name => $_value ) { |
| | 1723 | if ( str_starts_with( $name, $prefix ) ) { |
| | 1724 | $attribute_names[ $name ] = true; |
| | 1725 | } |
| | 1726 | } |
| | 1727 | |
| | 1728 | // Include enqueued attribute updates. |
| | 1729 | foreach ( $this->updated_attributes as $name => $value ) { |
| | 1730 | if ( null === $value ) { |
| | 1731 | unset( $attribute_names[ $name ] ); |
| | 1732 | continue; |
| | 1733 | } |
| | 1734 | |
| | 1735 | if ( str_starts_with( $name, $prefix ) ) { |
| | 1736 | $attribute_names[ $name ] = true; |
| | 1737 | } |
| | 1738 | } |
| | 1739 | |
| | 1740 | return array_keys( $attribute_names ); |
| 1720 | 1741 | } |
| 1721 | 1742 | } |