Returns the content between two balanced template tags.
Description
It positions the cursor in the closer tag of the balanced template tag, if it exists.
Source
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 );
}
Changelog
Version | Description |
---|---|
6.5.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.