Merge pull request woocommerce/woocommerce-beta-tester#51 from woocommerce/fix/loading-rest-api

Check WC version before calling WC_API::rest_api_includes()
This commit is contained in:
Claudio Sanches 2019-03-13 17:18:03 -03:00 committed by GitHub
commit 81fcdb9d17
1 changed files with 2 additions and 1 deletions

View File

@ -156,7 +156,8 @@ Copy and paste the system status report from **WooCommerce > System Status** in
$ssr = get_transient( $transient_name );
if ( false === $ssr ) {
if( ! did_action( 'rest_api_init' ) ) {
// When running WC 3.6 or greater it is necessary to manually load the REST API classes.
if ( version_compare( WC()->version, '3.6', '>=' ) && ! did_action( 'rest_api_init' ) ) {
WC()->api->rest_api_includes();
}