block_core_search_ensure_interactivity_dependency

The timeline below displays how wordpress function block_core_search_ensure_interactivity_dependency has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.4

/**
 * Ensure that the view script has the `wp-interactivity` dependency.
 *
 * @since 6.4.0
 *
 * @global WP_Scripts $wp_scripts
 */
function block_core_search_ensure_interactivity_dependency()
{
    global $wp_scripts;
    if (isset($wp_scripts->registered['wp-block-search-view']) && !in_array('wp-interactivity', $wp_scripts->registered['wp-block-search-view']->deps, true)) {
        $wp_scripts->registered['wp-block-search-view']->deps[] = 'wp-interactivity';
    }
}