Okay, so I am using the "FooEvents for WooCommerce" plugin for making WooCommerce products to events.
And now I wanna replace their WooCommerce hook 'woocommerce_order_status_completed'
with my own.
Their hook is placed in their class and method: FooEvents_Woo_Helper::_constructor()
And that class (FooEvents_Woo_Helper
) is only called by a private variable, $this->WooHelper
in another class, their "main class" FooEvents
.
So FooEvents_Woo_Helper
is called inside FooEvents
public method plugin_init()
:
//WooHelper
require_once($this->Config->classPath.'woohelper.php');
$this->WooHelper = new FooEvents_Woo_Helper($this->Config);
Now, I learned in another question I asked earlier about a similar question, here: How to Remove a Filter from the Admin List Table?
And I tried to do the same thing here, in different ways. But I can't make it to work. What am I doing wrong?:
function my_own_init() {
global $FooEvents;
if ( $FooEvents instanceof FooEvents ) {
remove_action( 'woocommerce_order_status_completed', array( $FooEvents->WooHelper, 'process_order_tickets' ) );
}
}
add_action( 'init', 'my_own_init', 11 );
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745346418a4623567.html
评论列表(0条)