LLMS_DOM_Document::load()
Load the HTML string in the DOMDocument
Description Description
This function suppresses PHP warnings that would be thrown by DOMDocument when loading a partial string or an HTML string with errors.
Return Return
(boolean|WP_Error) Returns true if the source is loaded fine. Or an error object when DOMDocument isn't available or an error is encountered during loading.
Source Source
File: includes/class-llms-dom-document.php
public function load() {
if ( is_wp_error( $this->error ) && $this->error->has_errors() ) {
return $this->error;
}
// Don't throw or log warnings.
$libxml_state = libxml_use_internal_errors( true );
$this->{$this->load_method}();
// Clear and restore errors.
libxml_clear_errors();
libxml_use_internal_errors( $libxml_state );
return is_wp_error( $this->error ) && $this->error->has_errors() ? $this->error : true;
}
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 4.13.0 | Introduced. |