Clanbite Since 1.3.0

enqueue_interactivity_for_plugin_templates( string $template ): string

Make the Interactivity API available to blocks rendered by a Clanbite plugin's own PHP template.

Plugin PHP templates (group pages, classic-theme fallbacks) call get_header() first and render blocks afterwards, so script modules enqueued by those blocks come too late for the import map that wp_head prints. Without it the browser cannot resolve @wordpress/interactivity and every interactive block stays inert. Enqueuing a tiny module that depends on it before wp_head puts it in the import map; blocks enqueued later then resolve it.

public

Class: Kernowdev\Clanbite\Main

Parameters

$template (string) Required

Template file chosen for the request.

Returns

string Unchanged template path.

Defined in clanbite.php

Changelog

VersionDescription
1.3.0Introduced.