MailPoet\EmailEditor\Integrations\Utils

Dom_Document_Helper::find_element()publicWC 1.0

Searches for the first appearance of the given tag name.

Method of the class: Dom_Document_Helper{}

No Hooks.

Return

null. Nothing (null).

Usage

$Dom_Document_Helper = new Dom_Document_Helper();
$Dom_Document_Helper->find_element( $tag_name ): ?\DOMElement;
$tag_name(string) (required)
The tag name to search for.

Dom_Document_Helper::find_element() code WC 9.8.1

public function find_element( string $tag_name ): ?\DOMElement {
	$elements = $this->dom->getElementsByTagName( $tag_name );
	return $elements->item( 0 ) ? $elements->item( 0 ) : null;
}