There was an error while loading. Please reload this page.
lhr_expiration_days
1 parent ff9e9f7 commit 990d6bfCopy full SHA for 990d6bf
log-http-requests.php
@@ -75,8 +75,9 @@ function cleanup() {
75
global $wpdb;
76
77
$now = current_time( 'timestamp' );
78
- $yesterday = date( 'Y-m-d H:i:s', strtotime( '-1 day', $now ) );
79
- $wpdb->query( "DELETE FROM {$wpdb->prefix}lhr_log WHERE date_added < '$yesterday'" );
+ $expires = apply_filters( 'lhr_expiration_days', 1 );
+ $expires = date( 'Y-m-d H:i:s', strtotime( '-' . $expires . ' days', $now ) );
80
+ $wpdb->query( "DELETE FROM {$wpdb->prefix}lhr_log WHERE date_added < '$expires'" );
81
}
82
83
0 commit comments