Fix filter hook if referer is disabled (#9)

The filter was only appended, if the referer live filter is set active. Now the condition checks for any available blacklist.
This commit is contained in:
Stefan Kalscheuer 2017-07-16 14:14:25 +02:00
parent 2873df7ecf
commit c7c0f9e346

View File

@ -69,7 +69,7 @@ class StatifyBlacklist {
self::$multisite = ( is_multisite() && array_key_exists( STATIFYBLACKLIST_BASE, (array) get_site_option( 'active_sitewide_plugins' ) ) ); self::$multisite = ( is_multisite() && array_key_exists( STATIFYBLACKLIST_BASE, (array) get_site_option( 'active_sitewide_plugins' ) ) );
// Add Filter to statify hook if enabled. // Add Filter to statify hook if enabled.
if ( 0 !== self::$_options['referer']['active'] ) { if ( 0 !== self::$_options['referer']['active'] || 0 !== self::$_options['target']['active'] || 0 !== self::$_options['ip']['active'] ) {
add_filter( 'statify__skip_tracking', array( 'StatifyBlacklist', 'apply_blacklist_filter' ) ); add_filter( 'statify__skip_tracking', array( 'StatifyBlacklist', 'apply_blacklist_filter' ) );
} }