$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>plugins - CampaignMonitor for WooCommerce - Move subscribe button|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

plugins - CampaignMonitor for WooCommerce - Move subscribe button

matteradmin7PV0评论
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 question

So 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 question

So 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?

Share Improve this question asked Jan 29, 2019 at 9:57 KeironLoweKeironLowe 1335 bronze badges 2
  • Try using an array for the callback name: remove_action( '...etc.', [ '\core\App', 'woocommerce_subscription_box' ] ); – Jacob Peattie Commented Jan 29, 2019 at 10:19
  • @JacobPeattie didn't work unfortunately. – KeironLowe Commented Jan 29, 2019 at 11:15
Add a comment  | 

1 Answer 1

Reset to default 0

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...

Post a comment

comment list (0)

  1. No comments so far