Automattic\WooCommerce\Vendor\Pelago\Emogrifier\HtmlProcessor
HtmlPruner::removeElementsWithDisplayNone
Removes elements that have a "display: none;" style.
Method of the class: HtmlPruner{}
No Hooks.
Returns
$this.
Usage
$HtmlPruner = new HtmlPruner(); $HtmlPruner->removeElementsWithDisplayNone(): self;
HtmlPruner::removeElementsWithDisplayNone() HtmlPruner::removeElementsWithDisplayNone code WC 10.7.0
public function removeElementsWithDisplayNone(): self
{
$elementsWithStyleDisplayNone = $this->getXPath()->query(self::DISPLAY_NONE_MATCHER);
if ($elementsWithStyleDisplayNone->length === 0) {
return $this;
}
foreach ($elementsWithStyleDisplayNone as $element) {
$parentNode = $element->parentNode;
if ($parentNode !== null) {
$parentNode->removeChild($element);
}
}
return $this;
}