Evaluates the reference path passed to a directive based on the current store namespace, state and context.
Parameters
$directive_value
string|truerequired- The directive attribute value string or
true
when it’s a boolean attribute. $default_namespace
stringrequired- The default namespace to use if none is explicitly defined in the directive value.
$context
array|falseoptional- The current context for evaluating the directive or false if there is no context.
Default:
false
Source
$this->context_stack = null;
return null === $result ? $html : $result;
}
/**
* Processes the interactivity directives contained within the HTML content
* and updates the markup accordingly.
*
* It uses the WP_Interactivity_API instance's context and namespace stacks,
* which are shared between all calls.
*
* This method returns null if the HTML contains unbalanced tags.
*
* @since 6.6.0
*
* @param string $html The HTML content to process.
* @return string|null The processed HTML content. It returns null when the HTML contains unbalanced tags.
*/
private function _process_directives( string $html ) {
$p = new WP_Interactivity_API_Directives_Processor( $html );
$tag_stack = array();
$unbalanced = false;
$directive_processor_prefixes = array_keys( self::$directive_processors );
$directive_processor_prefixes_reversed = array_reverse( $directive_processor_prefixes );
/*
* Save the current size for each stack to restore them in case
Changelog
Version | Description |
---|---|
6.5.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.