calcom / wp-plugin

GNU Affero General Public License v3.0
9 stars 5 forks source link

Uncaught ReferenceError: Cal is not Defined #3

Closed fredlisboa closed 9 months ago

fredlisboa commented 1 year ago

Hello guys, I'm having an issue with WordPress plug-in Cal.com, anyone could help me please?

Plug-in does not initiate, and gives Chrome errors (Uncaught ReferenceError: Cal is not Defined) . Installed plug-in, and used the shortcode with embed option (with or without the type= option will result in same error)

[cal url=/xxx/xx type=1]

Both the Elementor Shortcode and text editor widget will result in error as well. All plug-ins and WordPress are updated.

https://prnt.sc/NwpwvzjMRzRF

https://prnt.sc/CN5prmOaWEBH

CAL01 CAL02

asteinberger commented 1 year ago

Just add this code to your WordPress Instance: <script> (function (C, A, L) { let p = function (a, ar) { a.q.push(ar); }; let d = C.document; C.Cal = C.Cal || function () { let cal = C.Cal; let ar = arguments; if (!cal.loaded) { cal.ns = {}; cal.q = cal.q || []; d.head.appendChild(d.createElement("script")).src = A; cal.loaded = true; } if (ar[0] === L) { const api = function () { p(api, arguments); }; const namespace = ar[1]; api.q = api.q || []; typeof namespace === "string" ? (cal.ns[namespace] = api) && p(api, ar) : p(cal, ar); return; } p(cal, ar); }; })(window, "https://cal.com/embed.js", "init"); Cal("init"); </script>

krishnaglodha commented 10 months ago

Hi , is this issue resolved ?