nor1m
@nor1m
web-developer

Как удалить action в классе, который в плагине?

Есть класс :
class WC_Gateway_Amazon_Payments_Advanced extends WC_Payment_Gateway {
public function __construct() {
add_action( 'woocommerce_checkout_update_order_review', array( $this, 'store_shipping_info_in_session' ) );
}


Как удалить экшн woocommerce_checkout_update_order_review ?

Пробовал:

$class = new WC_Gateway_Amazon_Payments_Advanced();
remove_action( 'woocommerce_checkout_update_order_review', [$class, 'store_shipping_info_in_session'] );


$class = new WC_Gateway_Amazon_Payments_Advanced();
remove_action( 'woocommerce_checkout_update_order_review', ['WC_Gateway_Amazon_Payments_Advanced', 'store_shipping_info_in_session'] );


remove_filters_with_method_name( 'woocommerce_checkout_update_order_review', 'store_shipping_info_in_session' ); //(Вял отсюда - https://github.com/herewithme/wp-filters-extras/)


И даже так - prntscr.com/p7ztr7
  • Вопрос задан
  • 102 просмотра
Пригласить эксперта
Ответы на вопрос 1
@BATPYIIIKOB
PHP, JS
Просто не добавляйте его :)

// add_action( 'woocommerce_checkout_update_order_review', array( $this, 'store_shipping_info_in_session' ) );
Ответ написан
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы