Plugin Directory

Changeset 2276188


Ignore:
Timestamp:
04/05/2020 03:27:00 AM (5 years ago)
Author:
growniche
Message:

WordPress5.4でStripeの購入ボタンが表示されない問題を修正

Location:
simple-stripe-checkout/trunk
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • simple-stripe-checkout/trunk/readme.txt

    r2275585 r2276188  
    44Requires at least: 4.9.13
    55Tested up to: 5.4
    6 Stable tag: 1.0.1
     6Stable tag: 1.0.2
    77License: GPL v3 or later
    88License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    3333= 1.0.0 =
    3434* 2020-03-01 First release
    35 = 1.0.0 =
     35= 1.0.1 =
    3636* 2020-04-04 軽微な修正
     37= 1.0.2 =
     38* 2020-04-05 WordPress5.4でStripeの購入ボタンが表示されない問題を修正
  • simple-stripe-checkout/trunk/simple-stripe-checkout.php

    r2275585 r2276188  
    55  Plugin URI: https://s-page.biz/plugins/simple-stripe-checkout/
    66  Description: 決済プラットフォーム「Stripe」の連携プラグイン
    7   Version: 1.0.1
     7  Version: 1.0.2
    88  Author: growniche
    99  Author URI: https://www.growniche.co.jp/
     
    359359
    360360    /**
     361     * このプラグインのスクリプトのハンドル名
     362     */
     363    const SCRIPT_HANDLE = self::PLUGIN_ID . '-js';
     364
     365    /**
    361366     * CredentialAction(プレフィックス)
    362367     */
     
    10871092        // ショートコード処理の前準備
    10881093        add_action('wp_enqueue_scripts', [$this, 'pre_short_code']);
     1094        wp_enqueue_script('jquery' );
    10891095        // ショートコード処理を登録
    10901096        add_shortcode(self::PLUGIN_ID, [$this, 'short_code']);
     
    11271133     */
    11281134    function pre_short_code() {
    1129         $data = <<<EOS
    1130             jQuery(window).on('load', function() {
    1131                 jQuery(".gssc-form").each(function(index, element){
    1132                     var script = jQuery("<script>");
    1133                     script.attr("src", "https://checkout.stripe.com/checkout.js");
    1134                     script.addClass("stripe-button");
    1135                     script.attr("data-key", jQuery(element).data("key"));
    1136                     script.attr("data-amount", jQuery(element).data("amount"));
    1137                     script.attr("data-name", jQuery(element).data("name"));
    1138                     script.attr("data-description", jQuery(element).data("description"));
    1139                     script.attr("data-image", "https://stripe.com/img/documentation/checkout/marketplace.png");
    1140                     script.attr("data-locale", "auto");
    1141                     script.attr("data-currency", jQuery(element).data("currency"));
    1142                     script.attr("data-zip-code", "false");
    1143                     script.attr("data-allow-remember-me", "false");
    1144                     script.attr("data-label", jQuery(element).data("label"));
    1145                     script.appendTo(element);
    1146                 });
    1147             });
    1148 EOS;
    1149         wp_add_inline_script('jquery-core', $data );
     1135        wp_enqueue_script(self::SCRIPT_HANDLE, plugin_dir_url(__FILE__) . self::PLUGIN_ID . '.js');
    11501136    }
    11511137
Note: See TracChangeset for help on using the changeset viewer.