Standardized API to set unique IDs in directives

HTML does not allow multiple attributes with the same name on a single element, yet multiple plugins may need to add directives of the same type to the same element. To address this, WordPress 6.9 introduces a standardized way to assign unique IDs to Interactivity API directives, allowing an element to have multiple directives of the same type, as long as each directive has a different ID.

To assign a unique ID to a directive, append a triple-dash (---) followed by the ID, as shown in the following example.

 <div data-wp-watch---my-unique-id="callbacks.firstWatch"
Click here to continue reading this article.