Processes the data-wp-text
directive.
Description
It updates the inner content of the current HTML element based on the evaluation of its associated reference.
Parameters
$p
WP_Interactivity_API_Directives_Processorrequired- The directives processor instance.
$mode
stringrequired- Whether the processing is entering or exiting the tag.
$context_stack
arrayrequired- The reference to the context stack.
$namespace_stack
arrayrequired- The reference to the store namespace stack.
Source
/*
* If there is a namespace, it adds a new context to the stack merging the
* previous context with the new one.
*/
if ( is_string( $namespace_value ) ) {
$this->context_stack[] = array_replace_recursive(
end( $this->context_stack ) !== false ? end( $this->context_stack ) : array(),
array( $namespace_value => is_array( $decoded_json ) ? $decoded_json : array() )
);
} else {
/*
* If there is no namespace, it pushes the current context to the stack.
* It needs to do so because the function pops out the current context
* from the stack whenever it finds a `data-wp-context`'s closing tag.
*/
$this->context_stack[] = end( $this->context_stack );
Changelog
Version | Description |
---|---|
6.5.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.