I want to add some code to my child theme to remove an action set in the parent theme.
The action is:
add_action( 'woocommerce_product_options_inventory_product_data', array( 'Electro_WC_Helper', 'product_options_inventory_product_data' ) );
It is within a class 'Electro_WC_Helper'.
I have tried:
remove_action( 'woocommerce_product_options_inventory_product_data', array( 'Electro_WC_Helper', 'product_options_inventory_product_data' ), 99 );
Which didn't work, so I thought this is probably because the child functions is firing before the parent, so I added this:
add_action( 'admin_head', 'test_function', 99 );
function test_function() {
echo 'test543';
remove_action( 'woocommerce_product_options_inventory_product_data', array( Electro_WC_Helper, 'product_options_inventory_product_data' ), 99 );
}
Which also doesn't work.
How to remove the action?