更新时间:2023-12-05 23:50:40
若要删除非静态方法,应实例化该类,并删除wp_head
https://developer.wordpress.org/reference/functions/remove_action/
此外,Remove_action应该与Add操作具有相同的优先级,在本例中未指定该操作。
add_action( 'wp_head', 'remove_ppec_with_spb', 10);
function remove_ppec_with_spb() {
$class = new WC_Gateway_PPEC_With_SPB;
remove_action( 'woocommerce_review_order_after_submit', array( $class , 'display_paypal_button' ) );
}