Creates an HTML processor in the full parsing mode.
Description
It's likely that a fragment parser is more appropriate, unless sending an entire HTML document from start to finish. Consider a fragment parser with a context node of <body>. UTF-8 is the only allowed encoding. If working with a document that isn't UTF-8, first convert the document to UTF-8, then pass in the converted HTML.
Parameters
$htmlstring
Input HTML document to process.
$known_definite_encodingstring|nulloptional
If provided, specifies the charset used in the input byte stream. Currently must be UTF-8.Default: 'UTF-8'
Return
static|null
The created processor if successful, otherwise null.
354publicstaticfunctioncreate_full_parser($html,$known_definite_encoding='UTF-8'){355if('UTF-8'!==$known_definite_encoding){356returnnull;357}358if(!is_string($html)){359_doing_it_wrong(360__METHOD__,361__('The HTML parameter must be a string.'),362'6.9.0'363);364returnnull;365}366367$processor=newstatic($html,self::CONSTRUCTOR_UNLOCK_CODE);368$processor->state->encoding=$known_definite_encoding;369$processor->state->encoding_confidence='certain';370371return$processor;372}
History
Introduced in 6.7.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
Parsed data
Generated from the wordpress-develop 7.1.0 tag, from src/wp-includes/html-api/class-wp-html-processor.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.