Merges an individual style property in the style
attribute of an HTML element, updating or removing the property when necessary.
Description
If a property is modified, the old one is removed and the new one is added at the end of the list.
Parameters
$style_attribute_value
stringrequired- The current style attribute value.
$style_property_name
stringrequired- The style property name to set.
$style_property_value
string|false|nullrequired- The value to set for the style property. With false, null or an empty string, it removes the style property.
Source
if ( is_array( $decoded_json ) ) {
$new_namespace = $decoded_json['namespace'] ?? null;
} else {
$new_namespace = $attribute_value;
}
}
$this->namespace_stack[] = ( $new_namespace && 1 === preg_match( '/^([\w\-_\/]+)/', $new_namespace ) )
? $new_namespace
: end( $this->namespace_stack );
}
/**
* Processes the `data-wp-context` directive.
*
* It adds the context defined in the directive value to the stack so that
* it's available for the nested interactivity elements.
*
* @since 6.5.0
*
* @param WP_Interactivity_API_Directives_Processor $p The directives processor instance.
* @param string $mode Whether the processing is entering or exiting the tag.
*/
Changelog
Version | Description |
---|---|
6.5.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.