Consider using wp_enqueue_script
-
Hi Rob,
please consider to replace the manual inclusion of relevant javascript (and stylesheet) resources provided by Google through the use of the WordPress
wp_enquque_script
method. Furthermore, please consider externalizing eventual javascript snippets in a separate js-file in your plugins directory and include it in a similar way.For example, it resolves dependencies, duplicate inclusion of the same script is prevented automatically, and optimizations, such as minification, are automatically applied to them.
In particular, I am using a filter in my theme to remove
type="text/javascript"
tags from all enqueued javascripts as the type tag is deprecated, which cannot handle your included javascript tags.Thanks in advance,
Matthieu
Plugin-Version
5.0.41Affected Methods
google-language-translator.php:334
public function footer_script()
<script type='text/javascript' src='//translate.google.com/translate_a/element.js?cb=GoogleLanguageTranslatorInit'></script>
- The topic ‘Consider using wp_enqueue_script’ is closed to new replies.