From c3ef8d03a1c6b64a008b2a33b10c504b069a4800 Mon Sep 17 00:00:00 2001 From: Jeremy Herve Date: Tue, 15 Oct 2019 22:06:39 +0200 Subject: [PATCH] Tracks: use filter instead of relying on Jetpack class (#13746) See https://github.com/Automattic/jetpack/pull/13698#discussion_r334453278 --- src/Tracking.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Tracking.php b/src/Tracking.php index 7aa1476..98fc971 100644 --- a/src/Tracking.php +++ b/src/Tracking.php @@ -102,7 +102,16 @@ public function tracks_record_event( $user, $event_name, $properties = array(), } // Don't track users who have opted out or not agreed to our TOS, or are not running an active Jetpack. - if ( ! \Jetpack::jetpack_tos_agreed() ) { + if ( + /** + * Filter whether ToS were accepted on this site. + * + * @since 7.9.0 + * + * @param bool $tos_agreed Was ToS accepted for this site. Defaults to false. + */ + apply_filters( 'jetpack_tos_agreed', false ) + ) { return false; }