WP_Block_Processor::__construct
Creates a new block processor.
Example:
$processor = new WP_Block_Processor( $post_content );
if ( $processor->next_block( 'core/image' ) ) {
echo "Found an image!\n";
}
Method of the class: WP_Block_Processor{}
No Hooks.
Returns
null. Nothing (null).
Usage
$WP_Block_Processor = new WP_Block_Processor(); $WP_Block_Processor->__construct( $source_text );
- $source_text(string) (required)
- Input document potentially containing block content.
Notes
- See: self::next_block() to advance to the start of the next block (skips closers).
- See: self::next_delimiter() to advance to the next explicit block delimiter.
- See: self::next_token() to advance to the next block delimiter or HTML span.
Changelog
| Since 6.9.0 | Introduced. |
WP_Block_Processor::__construct() WP Block Processor:: construct code WP 7.0
public function __construct( string $source_text ) {
$this->source_text = $source_text;
}