LLMS_DOM_Document::__construct( string $source )
Constructor
Parameters Parameters
- $source
-
(string) (Required) An HTML string, either a full HTML document or a partial string.
Return Return
(void)
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(); }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
4.13.0 | Introduced. |