AMP_DOM_Utils::add_amp_action

AMP_DOM_Utils::add_amp_action( DOMElement $element,  string $event,  string $action )

Description #

Register an AMP action to an event on a given element.

If the element already contains one or more events or actions, the method will assemble them in a smart way.


Parameters #

$element

(DOMElement) (Required) Element to add an action to.

$event

(string) (Required) Event to trigger the action on.

$action

(string) (Required) Action to add.



Changelog #

Changelog
Version Description
1.4.0 Introduced.