File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -66,19 +66,23 @@ public static function has_logs() {
66
66
* Attached to the migration complete hook 'action_scheduler/migration_complete'.
67
67
*/
68
68
public static function maybe_schedule_cleanup () {
69
+ $ has_logs = 'no ' ;
70
+
69
71
$ args = array (
70
72
'type ' => ActionScheduler_wpCommentLogger::TYPE ,
71
73
'number ' => 1 ,
72
74
'fields ' => 'ids ' ,
73
75
);
74
76
75
77
if ( (bool ) get_comments ( $ args ) ) {
76
- update_option ( self :: $ has_logs_option_key , 'yes ' ) ;
78
+ $ has_logs = 'yes ' ;
77
79
78
80
if ( ! as_next_scheduled_action ( self ::$ cleanup_hook ) ) {
79
81
as_schedule_single_action ( gmdate ( 'U ' ) + ( 6 * MONTH_IN_SECONDS ), self ::$ cleanup_hook );
80
82
}
81
83
}
84
+
85
+ update_option ( self ::$ has_logs_option_key , $ has_logs , true );
82
86
}
83
87
84
88
/**
@@ -95,7 +99,7 @@ public static function delete_all_action_comments() {
95
99
)
96
100
);
97
101
98
- delete_option ( self ::$ has_logs_option_key );
102
+ update_option ( self ::$ has_logs_option_key, ' no ' , true );
99
103
}
100
104
101
105
/**
You can’t perform that action at this time.
0 commit comments