WordPress 7.2 ignores data-wp-init--, data-wp-watch-- and data-wp-run-- directives

Suffixes for the data-wp-init directive are not supported. Ignoring the directive with suffix "focus".

Short answer: WordPress 7.2 (due 8 December 2026, release candidate 17 November) stops running Interactivity API directives that use two hyphens for a unique ID: data-wp-init--name, data-wp-watch--name and data-wp-run--name are skipped, and data-wp-on--click--name waits for an event called "click--name" that never fires. WordPress 7.1 only warned. On live sites it fails silently. Jetpack's current Forms code uses this syntax. Plugin authors: switch to three hyphens. Site owners: test on 7.2 RC1 before updating.

Why it happens

A directive can carry a unique ID so one tag can have several directives of the same type. It used to be written after two hyphens (data-wp-init--focus); the supported form is three hyphens (data-wp-init---focus). WordPress 7.1's Interactivity runtime still ran the old form and warned that it "will stop working". In WordPress 7.2 (trunk), anything after two hyphens on init, watch, run and router-region is read as a suffix, which these directives don't accept: the init and watch handlers now run an entry only when its suffix is null, and run returns early. The warning exists only in the development build (loaded with SCRIPT_DEBUG); the minified build that live sites load has no warning text at all, so the feature simply stops. Jetpack's stable release on 28 October 2026 has data-wp-init--phone-field-custom-combobox, data-wp-init--focus and data-wp-watch--conditional-focus in jetpack-forms/src/contact-form/class-contact-form-field.php (lines 1731, 2160, 3463).

You may also see

The data-wp-on--click--track directive listens for an event named "click--track". Two-hyphen unique IDs are no longer supported. If you meant to add a unique ID, please use data-wp-on--click---track instead.
The usage of data-wp-init--focus (two hyphens for unique ID) is deprecated and will stop working in WordPress 7.1. Please use data-wp-init---focus (three hyphens for unique ID) from now on.

Fix

  1. Find two-hyphen IDs in your plugins and theme (run from the WordPress folder): grep -rEn 'data-wp-(init|watch|run)--[A-Za-z0-9_]|data-wp-on(-async)?(-window|-document)?--[A-Za-z0-9_]+--[A-Za-z0-9_]' wp-content/plugins wp-content/themes. Three-hyphen IDs are not matched, so every hit needs a change.
  2. Plugin and theme authors: add one hyphen before the ID. data-wp-init--focus becomes data-wp-init---focus; data-wp-on--click--track becomes data-wp-on--click---track. WordPress 7.1 already asks for this form, so ship the change before 17 November.
  3. Site owners: put a staging copy on WordPress 7.2 RC1 (17 November) with define( 'SCRIPT_DEBUG', true ); in wp-config.php, open pages with forms, search and other interactive blocks, and look for the warnings above in the browser console.
  4. If a plugin you rely on shows them, hold the 7.2 update until that plugin releases a fix (Jetpack: watch its changelog for Forms), then update both.

Watch out

Sources

Did this fix it?

What's still not working?

Describe what happens and paste any error message. We read every report and fix the page.

Other errors breaking soon

All "breaking soon" fixes