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:
commit
81fcdb9d17
|
@ -156,7 +156,8 @@ Copy and paste the system status report from **WooCommerce > System Status** in
|
||||||
$ssr = get_transient( $transient_name );
|
$ssr = get_transient( $transient_name );
|
||||||
|
|
||||||
if ( false === $ssr ) {
|
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();
|
WC()->api->rest_api_includes();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue