wp_interactivity(): WP_Interactivity_API

In this article

Retrieves the main WP_Interactivity_API instance.

Description

It provides access to the WP_Interactivity_API instance, creating one if it doesn’t exist yet.

Return

WP_Interactivity_API The main WP_Interactivity_API instance.

Source

* array.
*
* This helper function simplifies the creation of `data-wp-context` directives
* by providing a way to pass an array of data, which encodes into a JSON string
* safe for direct use as a HTML attribute value.
*
* Example:

Changelog

VersionDescription
6.5.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.