- Updates settings to use task scheduler method names from the newly
introduced config class
This commit is contained in:
@@ -255,6 +255,7 @@ class Menu {
|
|||||||
$data = array(
|
$data = array(
|
||||||
'settings' => $settings,
|
'settings' => $settings,
|
||||||
'segments' => Segment::getPublic()->findArray(),
|
'segments' => Segment::getPublic()->findArray(),
|
||||||
|
'task_scheduler' => TaskScheduler::getAvailableMethods(),
|
||||||
'pages' => Pages::getAll(),
|
'pages' => Pages::getAll(),
|
||||||
'flags' => $flags,
|
'flags' => $flags,
|
||||||
'current_user' => wp_get_current_user(),
|
'current_user' => wp_get_current_user(),
|
||||||
|
@@ -74,6 +74,13 @@ class Populator {
|
|||||||
private function createDefaultSettings() {
|
private function createDefaultSettings() {
|
||||||
$current_user = wp_get_current_user();
|
$current_user = wp_get_current_user();
|
||||||
|
|
||||||
|
if(!Setting::getValue('task_scheduler')) {
|
||||||
|
// disable task scheduler (cron) be default
|
||||||
|
Setting::setValue('task_scheduler', array(
|
||||||
|
'method' => TaskScheduler::METHOD_WORDPRESS
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
// default sender info based on current user
|
// default sender info based on current user
|
||||||
$sender = array(
|
$sender = array(
|
||||||
'name' => $current_user->display_name,
|
'name' => $current_user->display_name,
|
||||||
|
@@ -40,9 +40,8 @@
|
|||||||
<input
|
<input
|
||||||
type="radio"
|
type="radio"
|
||||||
name="task_scheduler[method]"
|
name="task_scheduler[method]"
|
||||||
value="WordPress"
|
value="<%= task_scheduler.wordpress %>"
|
||||||
<% if not(settings.task_scheduler.method)
|
<% if (settings.task_scheduler.method == task_scheduler.wordpress) %>
|
||||||
or (settings.task_scheduler.method == 'WordPress') %>
|
|
||||||
checked="checked"
|
checked="checked"
|
||||||
<% endif %>
|
<% endif %>
|
||||||
/><%= __('Visitors to your website (recommended)') %>
|
/><%= __('Visitors to your website (recommended)') %>
|
||||||
|
Reference in New Issue
Block a user