• Resolved James Hunt

    (@bonkerz)


    Using latest Ultimate Member, I am getting JavaScript error:

    Can't find variable: wp

    This relates to this block of code inserted by UM, particularly the bolded line:

    <script type='text/javascript'>
    ( function( domain, translations ) {
    	var localeData = translations.locale_data[ domain ] || translations.locale_data.messages;
    	localeData[""].domain = domain;
    	<strong>wp.i18n.setLocaleData( localeData, domain );</strong>
    } )( "default", { "locale_data": { "messages": { "": {} } } } );
    </script>

    I think this relates to a widely-used performance function we use to defer all JavaScript.

    1) I can specify files to not be deferred (i.e. jquery.js), but I don’t know what file the i18n snippet is relating to, can you let me know?
    2) Our site doesn’t need i18n, so how can I just remove this snippet from being added?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @bonkerz

    Sorry for the late response.

    Could you please check if the issue still occurs with the latest version?

    Feel free to re-open this thread if there’s any question that may come up.

    Regards,

    Thread Starter James Hunt

    (@bonkerz)

    Yes the issue seems to have gone away now

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Can’t find variable: wp – JavaScript error’ is closed to new replies.