且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

删除插件类中定义的操作

更新时间:2023-12-05 23:50:40

若要删除非静态方法,应实例化该类,并删除wp_headhttps://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' ) );
}