// Stripe 公開キーを JS に渡す処理を追加 add_action('wp_enqueue_scripts', 'mtssb_enqueue_stripe_script'); function mtssb_enqueue_stripe_script() { $plugin_url = plugin_dir_url(__FILE__); wp_enqueue_script( 'mtssb-booking-js', $plugin_url . 'js/mtssb-booking.js', array('jquery'), '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'] )); } }