wp-includes/interactivity-api/class-wp-interactivity-api-directives-processor.php:18Class used to iterate over the tags of an HTML string and help process the directive attributes.
final class WP_Interactivity_API_Directives_Processor extends WP_HTML_Tag_Processor { /** * List of tags whose closer tag is not visited by the WP_HTML_Tag_Processor. * * @since 6.5.0 * @var string[] */ const TAGS_THAT_DONT_VISIT_CLOSER_TAG = array( 'SCRIPT', 'IFRAME', 'NOEMBED', 'NOFRAMES', 'STYLE', 'TEXTAREA', 'TITLE', 'XMP', ); /** * Returns the content between two balanced template tags. * * It positions the cursor in the closer tag of the balanced template tag, * if it exists. * * @since 6.5.0 * * @access private * * @return string|null The content between the current opener template tag and its matching closer tag or null if it * doesn't find the matching closing tag or the current tag is not a template opener tag. */ public function get_content_between_balanced_template_tags() { if ( 'TEMPLATE' !== $this->get_tag() ) { return null; } $positions = $this->get_after_opener_tag_and_before_closer_tag_positions(); if ( ! $positions ) { return null; } list( $after_opener_tag, $before_closer_tag ) = $positions; return substr( $this->html, $after_opener_tag, $before_closer_tag - $after_opener_tag ); } /** * Sets the content between two balanced tags. * * @since 6.5.0 * * @access private * * @param string $new_content The string to replace the content between the matching tags. * @return bool Whether the content was successfully replaced. */ public function set_content_between_balanced_tags( string $new_content ): bool { $positions = $this->get_after_opener_tag_and_before_closer_tag_positions( true ); if ( ! $positions ) { return false; } list( $after_opener_tag, $before_closer_tag ) = $positions; $this->lexical_updates[] = new WP_HTML_Text_Replacement( $after_opener_tag, $before_closer_tag - $after_opener_tag, esc_html( $new_content ) ); return true; } /** * Appends content after the closing tag of a template tag. * * It positions the cursor in the closer tag of the balanced template tag, * if it exists. * * @access private * * @param string $new_content The string to append after the closing template tag.Introduced in 6.5.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
src/wp-includes/interactivity-api/class-wp-interactivity-api-directives-processor.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.