DevinVinson / WordPress-Plugin-Boilerplate

[WordPress] A foundation for WordPress Plugin Development that aims to provide a clear and consistent guide for building your plugins.
http://wppb.io
7.62k stars 2.25k forks source link

Added support for WordPress built in functions when creating hooks #579

Open prabch opened 1 year ago

prabch commented 1 year ago

Currently a hook defined as below would throw an error under Php 8

$this->loader->add_filter( 'woocommerce_single_product_zoom_enabled', null, '__return_false' );

This change let someone set the hook component as null, thus making built in WordPress functions accessible within the plugin using $this->loader->add_action or $this->loader->add_filter methods