Automattic\WooCommerce\EmailEditor\Integrations\Utils
Dom_Document_Helper::get_attribute_value
Returns the value of the given attribute from the given element.
Method of the class: Dom_Document_Helper{}
No Hooks.
Returns
null. Nothing (null).
Usage
$Dom_Document_Helper = new Dom_Document_Helper(); $Dom_Document_Helper->get_attribute_value( $element, $attribute ): string;
- $element(DOMElement) (required)
- The element to get the attribute value from.
- $attribute(string) (required)
- The attribute to get the value from.
Dom_Document_Helper::get_attribute_value() Dom Document Helper::get attribute value code WC 10.6.2
public function get_attribute_value( \DOMElement $element, string $attribute ): string {
return $element->hasAttribute( $attribute ) ? $element->getAttribute( $attribute ) : '';
}