LLMS_DOM_Document::__construct( string $source )

Constructor


Parameters Parameters

$source

(string) (Required) An HTML string, either a full HTML document or a partial string.


Top ↑

Return Return

(void)


Top ↑

Source Source

File: includes/class-llms-dom-document.php

	public function __construct( $source ) {

		if ( ! class_exists( 'DOMDocument' ) ) {
			$this->error = new WP_Error( 'llms-dom-document-missing', __( 'DOMDocument not available.', 'lifterlms' ) );
			return;
		}

		/**
		 * Filters the convert encoding method to be used when loading the source in the DOMDocument
		 *
		 * @param boolean $use_mb_convert_encoding Whether or not the convert encoding method should be used when loading the source in the DOMDocument.
		 *                                         Default is `true`. Requires `mbstring` PHP extension.
		 */
		$use_mb_convert_encoding = apply_filters( 'llms_dom_document_use_mb_convert_encoding', true );
		if ( ! ( $use_mb_convert_encoding && function_exists( 'mb_convert_encoding' ) ) ) {
			$this->load_method = 'load_with_meta_utf_fixer';
		}

		$this->source = $source;
		$this->dom    = new DOMDocument();
	}


Top ↑

Changelog Changelog

Changelog
Version Description
4.13.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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