// Stripe JS の読み込みと公開キーのJSへの埋め込み add_action('wp_enqueue_scripts', 'mtssb_enqueue_stripe_script'); function mtssb_enqueue_stripe_script() { $plugin_url = plugin_dir_url(__FILE__); wp_enqueue_script('stripe-js', 'https://js.stripe.com/v3/'); wp_enqueue_script('mtssb-booking-js', $plugin_url . 'js/mtssb-booking.js', array('stripe-js'), '1.0', true); $stripe_config = get_option('mts_simple_booking_stripe', []); if (!empty($stripe_config['publishable_key'])) { wp_localize_script('mtssb-booking-js', 'stripe_config', array( 'public_key' => $stripe_config['publishable_key'] )); } }