Repository navigation
Commit 4a17340
committed
fix: put the pixel's data attributes on its own script tag
The script_loader_tag filter receives the inline bootstrap printed before the
pixel as well as the pixel tag, and add_attributes() stamped the first
<script it found. The site key and every other data-* attribute landed on
the inline bootstrap, the pixel read its own tag through
document.currentScript, found no site key, and sent nothing.
Target the tag whose id is linkforty-pixel-js (single-quoted on WordPress
6.3, double-quoted from 6.4), falling back to the first tag with a src when
an optimization plugin has rewritten the id.1 parent d3a1c4e commit 4a17340
1 file changed
Lines changed: 21 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
135 | | - | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
136 | 140 | | |
137 | 141 | | |
138 | 142 | | |
| |||
149 | 153 | | |
150 | 154 | | |
151 | 155 | | |
152 | | - | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
153 | 172 | | |
154 | 173 | | |
0 commit comments