Skip to content

Commit 68ce307

Browse files
priethorcbravobernal
authored andcommitted
Update the acfL10n object to ensure it's available globally
1 parent d87f3a2 commit 68ce307

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

assets/src/js/_acf.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -673,9 +673,8 @@
673673
* @return string Translated text.
674674
*/
675675

676-
if ( window.acfL10n == undefined ) {
677-
acfL10n = {};
678-
}
676+
// Make sure a global acfL10n object exists to prevent errors in other scopes
677+
window.acfL10n = window.acfL10n || {};
679678

680679
acf.__ = function ( text ) {
681680
return acfL10n[ text ] || text;

0 commit comments

Comments
 (0)