Merge if-clauses for cron job detection

This commit is contained in:
Stefan Kalscheuer 2018-10-27 17:44:13 +02:00
parent 4dcd52e137
commit 59ff52cdef

View File

@ -109,12 +109,11 @@ class StatifyBlacklist {
}
// CronJob to clean up database.
if ( defined( 'DOING_CRON' ) && DOING_CRON ) {
if ( 1 === self::$_options['referer']['cron'] || 1 === self::$_options['target']['cron'] ) {
if ( defined( 'DOING_CRON' ) && DOING_CRON &&
( 1 === self::$_options['referer']['cron'] || 1 === self::$_options['target']['cron'] ) ) {
add_action( 'statify_cleanup', array( 'StatifyBlacklist_Admin', 'cleanup_database' ) );
}
}
}
/**
* Update options.