How to remove actions and filters added in the WoonderShop theme

In WoonderShop version v3.9.1 and later it is now possible to remove the filters and actions which theme adds in file inc/hooks.php. We have rewritten the class WooonderShopHooks in that file to the singleton design pattern which allows you to get the instance of that specific class in your own code (in plugins or child theme).

Also two other actions were added in that update:

  • woondershop_before_load
  • woondershop_loaded

To remove a filter added, for example woocommerce_default_address_fields use code like this in your child theme’s functions.php:

add_action( 'woondershop_loaded', function () {
  remove_filter( 'woocommerce_default_address_fields', array( WoonderShopHooks::get_instance(), 'set_placeholders_for_floating_labels_on_checkout' ) );
} );

Happy coding!