Problem
After AJAX navigation (Barba), inline body scripts are re-executed too broadly. This can re-run non-data/module scripts and trigger runtime errors (for example: Identifier 'a' has already been declared from the wp-emoji module script).
Repro
- Enable Page Transitions
- Navigate Home -> Work -> single -> Work via AJAX
- Observe console/runtime errors during transition lifecycle
Expected
Only safe data/config inline scripts should be re-applied, and module/json scripts should be ignored.
Proposed fix
- Restrict inline script syncing to safe patterns (
*-js-extra, FacetWP JSON assignment)
- Skip module and non-JS script types
- Preserve inline script id/type when re-injecting