Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.
Closed 6 years ago.
Improve this questionSo I need to move the checkbox provided by CampaignMonitor for WooCommerce to a different part of the checkout screen. I've already managed to copy it to the right place via
add_action( 'woocommerce_after_checkout_billing_form', '\core\App::woocommerce_subscription_box' );
But I can't remove it from it's original location. Looking at the plugin, it starts with...
add_action('plugins_loaded', function(){
// Truncated for brevity
core\App::run();
});
In core\App::run()
it just initiates the class, and in the constructor is
add_action('woocommerce_review_order_after_submit', array(__CLASS__, 'woocommerce_subscription_box'));
So we know how the action is being added, and I've tried all sorts but nothing works to remove the action from woocommerce_review_order_after_submit
.
I've tried...
// Doesn't work
remove_action( 'woocommerce_review_order_after_submit', '\core\App::woocommerce_subscription_box' );
// Doesn't work
add_action('plugins_loaded', function() {
remove_action( 'woocommerce_review_order_after_submit', '\core\App::woocommerce_subscription_box', 11 );
}, 11);
Can anyone understand why I can't seem to remove that action?
Closed. This question is off-topic. It is not currently accepting answers.Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.
Closed 6 years ago.
Improve this questionSo I need to move the checkbox provided by CampaignMonitor for WooCommerce to a different part of the checkout screen. I've already managed to copy it to the right place via
add_action( 'woocommerce_after_checkout_billing_form', '\core\App::woocommerce_subscription_box' );
But I can't remove it from it's original location. Looking at the plugin, it starts with...
add_action('plugins_loaded', function(){
// Truncated for brevity
core\App::run();
});
In core\App::run()
it just initiates the class, and in the constructor is
add_action('woocommerce_review_order_after_submit', array(__CLASS__, 'woocommerce_subscription_box'));
So we know how the action is being added, and I've tried all sorts but nothing works to remove the action from woocommerce_review_order_after_submit
.
I've tried...
// Doesn't work
remove_action( 'woocommerce_review_order_after_submit', '\core\App::woocommerce_subscription_box' );
// Doesn't work
add_action('plugins_loaded', function() {
remove_action( 'woocommerce_review_order_after_submit', '\core\App::woocommerce_subscription_box', 11 );
}, 11);
Can anyone understand why I can't seem to remove that action?
This works for me (not hooked to plugins_loaded):
remove_action('woocommerce_review_order_after_submit', array('core\App', 'woocommerce_subscription_box'));
Note there's also an option in the plugin settings 'Show subscription option at checkout' which will also remove it...
remove_action( '...etc.', [ '\core\App', 'woocommerce_subscription_box' ] );
– Jacob Peattie Commented Jan 29, 2019 at 10:19