Skip to content

Commit 8885272

Browse files
Anil KommareddiCopilot
andcommitted
Fix: declare ajaxurl global so FAQ accordion expand works
WordPress normally sets `var ajaxurl = '...'` as a standalone global. The static export only preserved it inside the `get` object: var get = {"ajaxurl":"", ...} So `ajaxurl` was an undeclared variable. Accessing it in `EWD_UFAQ_Reveal_FAQ` threw a ReferenceError that aborted the function before `removeClass('ewd-ufaq-hidden')` could run, silently preventing any FAQ from expanding. Fix: declare `var ajaxurl` at the top of ewd-ufaq.js, reading from `get.ajaxurl` if available, otherwise defaulting to ''. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent c2d9843 commit 8885272

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

content/plugins/ultimate-faqs/assets/js/ewd-ufaq.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
var filtering_running = false;
22
var wpforms_search_running = 'No';
3+
// WordPress normally sets ajaxurl as a global; on the static site it lives in get.ajaxurl
4+
var ajaxurl = (typeof get !== 'undefined' && get.ajaxurl) ? get.ajaxurl : '';
35

46
var ajax_ctrlr = {
57

0 commit comments

Comments
 (0)