Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't register actions when WooCommerce isn't active
Otherwise it will result in fatal errors like this: ``` [08-Mar-2017 15:03:35 UTC] PHP Fatal error: Uncaught Error: Call to undefined function wc_get_order() in /srv/git/_wordpoints-modules/woocommerce/src/classes/hook/action/order/delete.php:23 Stack trace: #0 /srv/git/wordpoints/src/classes/hook/router.php(147): WordPoints_WooCommerce_Hook_Action_Order_Delete->should_fire() #1 /srv/git/wordpoints/src/classes/hook/router.php(94): WordPoints_Hook_Router->route_action('delete_post,10', Array) #2 /srv/www/wordpress-develop/src/wp-includes/class-wp-hook.php(298): WordPoints_Hook_Router->__call('delete_post,10', Array) #3 /srv/www/wordpress-develop/src/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters(NULL, Array) #4 /srv/www/wordpress-develop/src/wp-includes/plugin.php(453): WP_Hook->do_action(Array) #5 /srv/www/wordpress-develop/src/wp-includes/post.php(2508): do_action('delete_post', '143') #6 /srv/www/wordpress-develop/src/wp-includes/post.php(6048): wp_delete_post('143', true) #7 /srv/www/wordpress-develop/src/wp-includes/class-wp-hook.php(298): wp_delete_auto_drafts() #8 /srv/www/wordpress-develo in /srv/git/_wordpoints-modules/woocommerce/src/classes/hook/action/order/delete.php on line 23 ``` If WooCommerce isn't active, our events and actions won't operate properly, and neither will our entities, etc. So there is no since in registering them.
- Loading branch information