WP_HTML_Processor::get_modifiable_text()
Returns the modifiable text for a matched token, or an empty string.
Modifiable text is text content that may be read and changed without changing the HTML structure of the document around it. This includes the contents of #text nodes in the HTML as well as the inner contents of HTML comments, Processing Instructions, and others, even though these nodes aren't part of a parsed DOM tree. They also contain the contents of SCRIPT and STYLE tags, of TEXTAREA tags, and of any other section in an HTML document which cannot contain HTML markup (DATA).
If a token has no modifiable text then an empty string is returned to avoid needless crashing or type errors. An empty string does not mean that a token has modifiable text, and a token with modifiable text may have an empty string (e.g. a comment with no contents).
Method of the class: WP_HTML_Processor{}
No Hooks.
Return
String
.
Usage
$WP_HTML_Processor = new WP_HTML_Processor(); $WP_HTML_Processor->get_modifiable_text();
Changelog
Since 6.6.0 | Introduced. |
Since 6.6.0 | Subclassed for the HTML Processor. |
WP_HTML_Processor::get_modifiable_text() WP HTML Processor::get modifiable text code WP 6.6.2
public function get_modifiable_text() { return $this->is_virtual() ? '' : parent::get_modifiable_text(); }