diff --git a/includes/class-wc-api.php b/includes/class-wc-api.php index ff27619de7a..c360d490a18 100644 --- a/includes/class-wc-api.php +++ b/includes/class-wc-api.php @@ -174,6 +174,8 @@ class WC_API extends WC_Legacy_API { include_once( dirname( __FILE__ ) . '/api/class-wc-rest-webhooks-controller.php' ); include_once( dirname( __FILE__ ) . '/api/class-wc-rest-system-status-controller.php' ); include_once( dirname( __FILE__ ) . '/api/class-wc-rest-system-status-tools-controller.php' ); + + do_action( 'woocommerce_api_includes' ); } /** @@ -184,7 +186,7 @@ class WC_API extends WC_Legacy_API { // Register settings to the REST API. $this->register_wp_admin_settings(); - $controllers = array( + $controllers = apply_filters( 'woocommerce_api_controllers', array( 'WC_REST_Coupons_Controller', 'WC_REST_Customer_Downloads_Controller', 'WC_REST_Customers_Controller', @@ -212,7 +214,7 @@ class WC_API extends WC_Legacy_API { 'WC_REST_Webhooks_Controller', 'WC_REST_System_Status_Controller', 'WC_REST_System_Status_Tools_Controller', - ); + ) ); foreach ( $controllers as $controller ) { $this->$controller = new $controller();