返信先: JavaScriptの出力場所

フォーラム 要望と提案 JavaScriptの出力場所 返信先: JavaScriptの出力場所

#80284
mint1414
参加者

uishiさん

お返事ありがとうございます。
「[解決済]: wp_add_inline_style で既存のハンドルに依存してCSSを出力する方法について」を読んでみたのですが、理解力がないのもありますが、ちょっと違うような気がしました。

現在は下記のように出力されています。
jquery-1.12.4.min.jsより前に出力されているのが、welcartプラグインが出力しているJavaScriptなのですが、これを、jquery-1.12.4.min.jsの後に出てほしいです。

<script type='text/javascript'>
  uscesL10n = {
    'ajaxurl': "http://localhost/shopwelcart/wordpress4/wp-admin/admin-ajax.php",
    'loaderurl': "http://localhost/shopwelcart/wordpress4/wp-content/plugins/usc-e-shop/images/loading.gif",
    'post_id': "194",
    'cart_number': "4",(以下省略)
  }</script>
<script type='text/javascript' src='http://localhost/shopwelcart/wordpress4/wp-content/plugins/usc-e-shop/js/usces_cart.js'></script>
<!-- Welcart version : v1.8.8.1608161 -->
<script type='text/javascript' src='http://localhost/shopwelcart/wordpress4/wp-content/themes/welcart_default/js/jquery-1.12.4.min.js?ver=1.12.4'></script>
<script type='text/javascript' src='http://localhost/shopwelcart/wordpress4/wp-content/plugins/contact-form-7/includes/js/jquery.form.min.js?ver=3.51.0-2014.06.20'></script>
<script type='text/javascript' src='http://localhost/shopwelcart/wordpress4/wp-content/plugins/contact-form-7/includes/js/scripts.js?ver=4.5'></script>
<script type='text/javascript' src='http://localhost/shopwelcart/wordpress4/wp-content/themes/welcart_default/js/bootstrap.min.js?ver=3.3.7'></script>

welcartが出力しているファイル(wp-content/plugins/usc-e-shop/classes/usceshop.class.php)を見ると、記述がphpコードの外に記述されているので、この順番を変えるのは難しいのかな?と思いましたが、どうなんでしょうか?