WP_HTML_Processor::set_attribute( string $name, string|bool $value ): bool

In this article

Updates or creates a new attribute on the currently matched tag with the passed value.

Description

For boolean attributes special handling is provided:

  • When true is passed as the value, then only the attribute name is added to the tag.
  • When false is passed, the attribute gets removed if it existed before.

For string attributes, the value is escaped using the esc_attr function.

Parameters

$namestringrequired
The attribute name to target.
$valuestring|boolrequired
The new attribute value.

Return

bool Whether an attribute value was set.

Source

 */
case '-HEAD':
	$this->state->stack_of_open_elements->pop();

Changelog

VersionDescription
6.6.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.