woocommerce/plugins
Rodrigo Primo 60836b698f Check WC version before calling WC_API::rest_api_includes()
When running WC 3.6 or greater it is necessary to call WC_API::rest_api_includes() to manually load the WC REST API classes. The problem is that this method was private before WC 3.6, so this commit adds a check to only call WC_API::rest_api_includes() when the WC version is 3.6 or greater. For WC older versions, loading the classes is not necessary, as they are always loaded by default.

Without this change, the following error happens when using the beta tester plugin with WC < 3.6:

```
Fatal error: Uncaught Error: Call to private method WC_API::rest_api_includes() from context 'WC_Beta_Tester_Admin_Menus' in /srv/www/wc-beta-tester/htdocs/wp-content/plugins/woocommerce-beta-tester/includes/class-wc-beta-tester-admin-menus.php on line 161
```

Related woocommerce/woocommerce-beta-tester#50
2019-03-13 15:28:58 -03:00
..
woocommerce-beta-tester Check WC version before calling WC_API::rest_api_includes() 2019-03-13 15:28:58 -03:00