Commit beee122
committed
Fix token config missing forms rendered via wp_footer
The localized script config was built at wp_footer priority 1, before
themes/plugins that render Gravity Forms in modals or popups via
wp_footer at default priority. Those forms were never included in the
config, so the JS never injected a token for them — causing every
submission to be flagged as spam with "did not include a spam prevention
token."
Replace wp_localize_script (called at wp_footer priority 1) with
script_loader_tag, which fires during wp_print_footer_scripts
(wp_footer priority 20). This guarantees the config includes all forms
collected up to script print time.1 parent 2c3fb0b commit beee122
2 files changed
Lines changed: 27 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
276 | 276 | | |
277 | 277 | | |
278 | 278 | | |
279 | | - | |
280 | | - | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
281 | 285 | | |
282 | 286 | | |
283 | 287 | | |
284 | 288 | | |
285 | 289 | | |
286 | | - | |
| 290 | + | |
287 | 291 | | |
288 | | - | |
289 | | - | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
290 | 295 | | |
291 | | - | |
| 296 | + | |
292 | 297 | | |
293 | | - | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
294 | 302 | | |
295 | | - | |
296 | | - | |
297 | | - | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
298 | 306 | | |
299 | 307 | | |
300 | | - | |
301 | | - | |
302 | | - | |
| 308 | + | |
303 | 309 | | |
304 | 310 | | |
305 | 311 | | |
306 | 312 | | |
307 | 313 | | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
308 | 318 | | |
309 | 319 | | |
310 | 320 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
113 | 117 | | |
114 | 118 | | |
115 | 119 | | |
| |||
0 commit comments