Skip to content

Commit d6133f4

Browse files
committed
Activate/Deactivate Button
1 parent c516876 commit d6133f4

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

mathilda_tools.php

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -224,11 +224,20 @@ function mathilda_tools() {
224224
<p><strong>Auto Load has been deactivated.</strong></p>
225225
</div>';
226226
} else {
227-
update_option('mathilda_cron_status','1');
228-
$label_cronstatus_button="Deactivate!";
229-
echo '<div class="updated fade">
230-
<p><strong>Auto Load has been activated.</strong></p>
231-
</div>';
227+
228+
$initial_load = get_option('mathilda_initial_load');
229+
if($initial_load==1) {
230+
update_option('mathilda_cron_status','1');
231+
$label_cronstatus_button="Deactivate!";
232+
echo '<div class="updated fade">
233+
<p><strong>Auto Load has been activated.</strong></p>
234+
</div>';
235+
} else {
236+
echo '<div class="notice notice-warning is-dismissible">
237+
<p><strong>Auto Load can still not be activated. You have to run an initial load manually first (Load Tweets).</strong></p>
238+
</div>';
239+
}
240+
232241
}
233242
}
234243
}

0 commit comments

Comments
 (0)