Automattic\WooCommerce\EmailEditor\Integrations\Utils

Dom_Document_Helper::find_elements │ public │ WC 1.0

Returns every element matching the given tag name, in document order.

Method of the class: Dom_Document_Helper{}

No Hooks.

Returns

array<int, \DOMElement>.

Usage

$Dom_Document_Helper = new Dom_Document_Helper();
$Dom_Document_Helper->find_elements( $tag_name ): array;
$tag_name(string) (required)
The tag name to search for.

Dom_Document_Helper::find_elements() code WC 11.1.2

public function find_elements( string $tag_name ): array {
	$elements = array();
	foreach ( $this->dom->getElementsByTagName( $tag_name ) as $element ) {
		if ( $element instanceof \DOMElement ) {
			$elements[] = $element;
		}
	}
	return $elements;
}