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.
349publicstaticfunctioncreate_full_parser($html,$known_definite_encoding='UTF-8'){350if('UTF-8'!==$known_definite_encoding){351returnnull;352}353if(!is_string($html)){354_doing_it_wrong(355__METHOD__,356__('The HTML parameter must be a string.'),357'6.9.0'358);359returnnull;360}361362$processor=newstatic($html,self::CONSTRUCTOR_UNLOCK_CODE);363$processor->state->encoding=$known_definite_encoding;364$processor->state->encoding_confidence='certain';365366return$processor;367}
Signature, return type and hooks compared across 5 parsed releases.
About this page
Parsed data
Generated from the wordpress-develop 7.0.4 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.