Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness. Use WP_HTML_Processor::create_fragment() instead.

WP_HTML_Processor::__construct( string $html, string|null $use_the_static_create_methods_instead = null )



Do not use this method. Use the static creator methods instead.

Top ↑

See also

Top ↑


$html string Required
HTML to process.
$use_the_static_create_methods_instead string|null Optional
This constructor should not be called manually.

Default: null

Top ↑


File: wp-includes/html-api/class-wp-html-processor.php. View all references

public function __construct( $html, $use_the_static_create_methods_instead = null ) {
	parent::__construct( $html );

	if ( self::CONSTRUCTOR_UNLOCK_CODE !== $use_the_static_create_methods_instead ) {
				/* translators: %s: WP_HTML_Processor::create_fragment(). */
				__( 'Call %s to create an HTML Processor instead of calling the constructor directly.' ),

	$this->state = new WP_HTML_Processor_State();

	 * Create this wrapper so that it's possible to pass
	 * a private method into WP_HTML_Token classes without
	 * exposing it to any public API.
	$this->release_internal_bookmark_on_destruct = function ( $name ) {
		parent::release_bookmark( $name );

Top ↑


Version Description
6.4.0 Introduced.

Top ↑

User Contributed Notes

You must log in before being able to contribute a note or feedback.