Check for class not version

This commit is contained in:
Mike Jolley 2016-08-01 11:42:03 +01:00
parent bc65d87fce
commit 1f664e7c5e
1 changed files with 1 additions and 3 deletions

View File

@ -110,10 +110,8 @@ class WC_API extends WC_Legacy_API {
* @since 2.6.0
*/
private function rest_api_init() {
global $wp_version;
// REST API was included starting WordPress 4.4.
if ( version_compare( $wp_version, 4.4, '<' ) ) {
if ( ! class_exists( 'WP_REST_Server' ) ) {
return;
}