Merge pull request #24140 from woocommerce/fix/jetpack-tracks-id

Fix namespaced Jetpack tracks_get_identity
This commit is contained in:
Claudio Sanches 2019-07-12 12:35:40 -03:00 committed by GitHub
commit 3b9b186035
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -139,7 +139,7 @@ class WC_Tracks_Client {
public static function get_identity( $user_id ) {
$jetpack_lib = '/tracks/client.php';
if ( class_exists( 'Jetpack' ) && defined( JETPACK__VERSION ) ) {
if ( class_exists( 'Jetpack' ) && defined( 'JETPACK__VERSION' ) ) {
if ( version_compare( JETPACK__VERSION, '7.5', '<' ) ) {
if ( file_exists( jetpack_require_lib_dir() . $jetpack_lib ) ) {
include_once jetpack_require_lib_dir() . $jetpack_lib;
@ -148,7 +148,8 @@ class WC_Tracks_Client {
}
}
} else {
return Automattic\Jetpack\Tracking::tracks_get_identity( $user_id );
$tracking = new Automattic\Jetpack\Tracking();
return $tracking->tracks_get_identity( $user_id );
}
}