Merge pull request #20000 from woocommerce/update/19983

Exclude frontend include from REST API calls
This commit is contained in:
Mike Jolley 2018-05-24 17:11:27 +01:00 committed by GitHub
commit 3a673aa4e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -240,7 +240,7 @@ final class WooCommerce {
case 'cron':
return defined( 'DOING_CRON' );
case 'frontend':
return ( ! is_admin() || defined( 'DOING_AJAX' ) ) && ! defined( 'DOING_CRON' );
return ( ! is_admin() || defined( 'DOING_AJAX' ) ) && ! defined( 'DOING_CRON' ) && ! defined( 'REST_REQUEST' );
}
}