WP_Interactivity_API::process_directives( string $html ): string

In this article

Processes the interactivity directives contained within the HTML content and updates the markup accordingly.

Parameters

$htmlstringrequired
The HTML content to process.

Return

string The processed HTML content. It returns the original content when the HTML contains unbalanced tags.

Source

public function process_directives( string $html ): string {
	if ( ! str_contains( $html, 'data-wp-' ) ) {
		return $html;
	}

	$context_stack   = array();
	$namespace_stack = array();
	$result          = $this->process_directives_args( $html, $context_stack, $namespace_stack );
	return null === $result ? $html : $result;
}

Changelog

VersionDescription
6.5.0Introduced.

User Contributed Notes

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