Creates a new block processor.
Description
Example:
$processor = new WP_Block_Processor( $post_content );
if ( $processor->next_block( 'core/image' ) ) {
echo "Found an image!\n";
}
See also
- WP_Block_Processor::next_block(): to advance to the start of the next block (skips closers).
- WP_Block_Processor::next_delimiter(): to advance to the next explicit block delimiter.
- WP_Block_Processor::next_token(): to advance to the next block delimiter or HTML span.
Parameters
$source_textstringrequired- Input document potentially containing block content.
Source
public function __construct( string $source_text ) {
$this->source_text = $source_text;
}
Changelog
| Version | Description |
|---|---|
| 6.9.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.