Use WooCommerce filters/hooks instead of hardcoding include files
-
I’m looking into getting the plugin working with WooCommerce as a MU plugin and noticed the following code issues that would prevent an simple fix/override using WooCommerce as an MU plugin. The path for the MU plugin would simply be
mu-plugin/
instead ofplugin/
The following code looks like it would be unnecessary if a WooCommerce hook was used (
woocommerce_get_settings_pages
).if(!class_exists('\WC_Settings_Page')){ include_once WP_CONTENT_DIR . '/plugins/woocommerce/includes/admin/settings/class-wc-settings-page.php'; }
This is also the case with Abstract_Gateway that extends
WC_Payment_Gateway
.
- The topic ‘Use WooCommerce filters/hooks instead of hardcoding include files’ is closed to new replies.