Skip to content

Commit 65d97ed

Browse files
authored
Merge pull request #800 from Codeinwp/bugfix/298
Automatically update chart data
2 parents 1355fbe + f48b864 commit 65d97ed

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

classes/Visualizer/Module/Chart.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,10 @@ public function setJsonSchedule() {
139139

140140
if ( -1 < $time ) {
141141
add_post_meta( $chart_id, Visualizer_Plugin::CF_JSON_SCHEDULE, $time );
142+
// Update schedules.
143+
$schedules = get_option( Visualizer_Plugin::CF_JSON_SCHEDULE, array() );
144+
$schedules[ $chart_id ] = time() + $time * HOUR_IN_SECONDS;
145+
update_option( Visualizer_Plugin::CF_JSON_SCHEDULE, $schedules );
142146
}
143147
wp_send_json_success();
144148
}

0 commit comments

Comments
 (0)