Skip to content

Commit

Permalink
Tracks: use filter instead of relying on Jetpack class (#13746)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeherve authored and kraftbj committed Oct 15, 2019
1 parent ac97b59 commit c3ef8d0
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/Tracking.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit c3ef8d0

Please sign in to comment.