How to disable action – woocommerce_gateway_stripe_init
-
In the plugin ‘woocommerce-gateway-stripe’ there is a file called woocommerce-gateway-stripe.php
On line 734 there is this line: add_action( ‘plugins_loaded’, ‘woocommerce_gateway_stripe_init’ );
I want to REMOVE this action as I don’t want the scripts which it triggers to run.
I have tried various ways to remove it including things like this:
add_action(‘plugins_loaded’, ‘remove_stripe_action_wp_loaded’, 200);
function remove_stripe_action_wp_loaded() {
// Remove the action if it exists
if ( has_action('plugins_loaded', 'woocommerce_gateway_stripe_init') ) {
remove_action('plugins_loaded', 'woocommerce_gateway_stripe_init');
error_log('Successfully removed woocommerce_gateway_stripe_init from plugins_loaded on wp_loaded.');
}However, it is very stubborn and nothing I try is working. Is there a specific WooCommerce hook which I can hook into in order to stop this from running? I only want it to not run on certain pages which is why I am doing this and not just disabling it.
You will know that you ahve disabled it correctly if there is no API called made to – https://js.stripe.com/v3/?ver=3.0
Right now this is being called on this page and it is really slowing it down
The page I need help with: [log in to see the link]
- You must be logged in to reply to this topic.