remove an action hook function on a plugin from a theme
first I did my homework by checking the answer on this question and this question, both didn't work.
after long debuging the function I want to remove is protected in 2 nested classes, and follows this path:
class Sub_class{
function __construct(){
add_action('my_action_name',array($this, 'the_hated_function'), 200);
}
function the_hated_function(){
// does some bs
}
}
class Mother_class{
public $my_propreity;
function __construct(){
add_action( 'init', array( $this, 'init' ), 10 );
}
function init(){
if(/* condition */ true){
$this-my_propreity = new Sub_class();
}
}
}
so am trying to remove the hated function from a theme am creating.
for what it's worth the plugin is availabe in the wordpress market place directory WCFM - WooCommerce Frontend Manager
. the action hook is end_wcfm_products_manage
and the hated function is wcfm_custom_field_products_manage_views
.
am well aware the remove should happen after the function was added and before the hook is fired. and that the order number should also be considered (10 and 200) otherwise it wont work.
thank you all for your help.