Skip to content

Commit

Permalink
get_enqueued_attribute_value needs to operate on attribute_updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ockham committed Jan 26, 2023
1 parent 41a3919 commit 8b92ec6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/experimental/html/class-wp-html-tag-processor.php
Original file line number Diff line number Diff line change
Expand Up @@ -1439,11 +1439,11 @@ private static function sort_start_ascending( $a, $b ) {
* @return string|boolean|null Value of enqueued update if present, otherwise false.
*/
private function get_enqueued_attribute_value( $comparable_name ) {
if ( ! isset( $this->lexical_updates[ $comparable_name ] ) ) {
if ( ! isset( $this->attribute_updates[ $comparable_name ] ) ) {
return false;
}

$enqueued_text = $this->lexical_updates[ $comparable_name ]->text;
$enqueued_text = $this->attribute_updates[ $comparable_name ]->text;

// Removed attributes erase the entire span.
if ( '' === $enqueued_text ) {
Expand Down Expand Up @@ -1517,7 +1517,7 @@ public function get_attribute( $name ) {

/*
* For every attribute other than `class` we can perform a quick check if there's an
* enqueued lexical update whose value we should prefer over what's in the input HTML.
* enqueued attribute update whose value we should prefer over what's in the input HTML.
*
* The `class` attribute is special though because we expose the helpers `add_class`
* and `remove_class` which form a builder for the `class` attribute, so we have to
Expand Down Expand Up @@ -1818,8 +1818,8 @@ public function remove_attribute( $name ) {

// If we updated an attribute we didn't originally have, remove the enqueued update and move on.
if ( ! isset( $this->attributes[ $name ] ) ) {
if ( isset( $this->lexical_updates[ $name ] ) ) {
unset( $this->lexical_updates[ $name ] );
if ( isset( $this->attribute_updates[ $name ] ) ) {
unset( $this->attribute_updates[ $name ] );
}
return false;
}
Expand Down

0 comments on commit 8b92ec6

Please sign in to comment.