| 1 |
<?php |
| 2 |
require_once("Arrays_Definitions.php"); |
| 3 |
$now_t = current_time( "timestamp" ); |
| 4 |
global $timed_content_rule_occurrence_custom_fields, $timed_content_rule_pattern_custom_fields, $timed_content_rule_recurrence_custom_fields; |
| 5 |
|
| 6 |
$timed_content_rule_occurrence_custom_fields = array( |
| 7 |
array( |
| 8 |
"name" => "action", |
| 9 |
"display" => "block", |
| 10 |
"title" => __( "Action", 'timed-content' ), |
| 11 |
"description" => __( "Sets the action to be performed when the rule is active.", 'timed-content' ), |
| 12 |
"type" => "radio", |
| 13 |
"values" => array( 1 => __( "Show the content", 'timed-content' ), |
| 14 |
0 => __( "Hide the content", 'timed-content' ) ), |
| 15 |
"default" => 1, |
| 16 |
"scope" => array( TIMED_CONTENT_RULE_TYPE ), |
| 17 |
"capability" => "edit_posts" |
| 18 |
), |
| 19 |
array( |
| 20 |
"name" => "instance_start", |
| 21 |
"display" => "block", |
| 22 |
"title" => __( "Starting Date/Time", 'timed-content' ), |
| 23 |
"description" => __( "Sets the date and time for the beginning of the first active period for this rule.", 'timed-content' ), |
| 24 |
"type" => "datetime", |
| 25 |
"default" => array( "date" => date( "F jS, Y", strtotime( "+1 hour", $now_t ) ), |
| 26 |
"time" => date( "g:i A", strtotime( "+1 hour", $now_t ) ) ), |
| 27 |
"scope" => array( TIMED_CONTENT_RULE_TYPE ), |
| 28 |
"capability" => "edit_posts" |
| 29 |
), |
| 30 |
array( |
| 31 |
"name" => "instance_end", |
| 32 |
"display" => "block", |
| 33 |
"title" => __( "Ending Date/Time", 'timed-content' ), |
| 34 |
"description" => __( "Sets the date and time for the end of the first active period for this rule.", 'timed-content' ), |
| 35 |
"type" => "datetime", |
| 36 |
"default" => array( "date" => date( "F jS, Y", strtotime( "+2 hour", $now_t ) ), |
| 37 |
"time" => date( "g:i A", strtotime( "+2 hour", $now_t ) ) ), |
| 38 |
"scope" => array( TIMED_CONTENT_RULE_TYPE ), |
| 39 |
"capability" => "edit_posts" |
| 40 |
), |
| 41 |
array( |
| 42 |
"name" => "timezone", |
| 43 |
"display" => "block", |
| 44 |
"title" => __( "Timezone:", 'timed-content' ), |
| 45 |
"description" => __( "Select a city in the timezone you wish to use for this rule.", 'timed-content' ), |
| 46 |
"type" => "timezone-list", |
| 47 |
"default" => get_option('timezone_string'), |
| 48 |
"scope" => array( TIMED_CONTENT_RULE_TYPE ), |
| 49 |
"capability" => "edit_posts" |
| 50 |
) |
| 51 |
); |
| 52 |
$timed_content_rule_pattern_custom_fields = array( |
| 53 |
array( |
| 54 |
"name" => "frequency", |
| 55 |
"display" => "block", |
| 56 |
"title" => __( "Frequency:", 'timed-content' ), |
| 57 |
"description" => __( "Sets the frequency at which the action should be repeated.", 'timed-content' ), |
| 58 |
"type" => "list", |
| 59 |
"default" => "1", |
| 60 |
"values" => $timed_content_rule_freq_array, |
| 61 |
"scope" => array( TIMED_CONTENT_RULE_TYPE ), |
| 62 |
"capability" => "edit_posts" |
| 63 |
), |
| 64 |
array( |
| 65 |
"name" => "hourly_num_of_hours", |
| 66 |
"display" => "none", |
| 67 |
"title" => __( "Repeat How Often?", 'timed-content' ), |
| 68 |
"description" => __( "If the frequency is set to Hourly, repeat this action every X hours.", 'timed-content' ), |
| 69 |
"type" => "number", |
| 70 |
"default" => "1", |
| 71 |
"min" => "1", |
| 72 |
"scope" => array( TIMED_CONTENT_RULE_TYPE ), |
| 73 |
"capability" => "edit_posts" |
| 74 |
), |
| 75 |
array( |
| 76 |
"name" => "daily_num_of_days", |
| 77 |
"display" => "none", |
| 78 |
"title" => __( "Repeat How Often?", 'timed-content' ), |
| 79 |
"description" => __( "If the frequency is set to Daily, repeat this action every X days.", 'timed-content' ), |
| 80 |
"type" => "number", |
| 81 |
"default" => "1", |
| 82 |
"min" => "1", |
| 83 |
"scope" => array( TIMED_CONTENT_RULE_TYPE ), |
| 84 |
"capability" => "edit_posts" |
| 85 |
), |
| 86 |
array( |
| 87 |
"name" => "weekly_num_of_weeks", |
| 88 |
"display" => "none", |
| 89 |
"title" => __( "Repeat How Often?", 'timed-content' ), |
| 90 |
"description" => __( "If the frequency is set to Weekly, repeat this action every X weeks.", 'timed-content' ), |
| 91 |
"type" => "number", |
| 92 |
"default" => "1", |
| 93 |
"min" => "1", |
| 94 |
"scope" => array( TIMED_CONTENT_RULE_TYPE ), |
| 95 |
"capability" => "edit_posts" |
| 96 |
), |
| 97 |
array( |
| 98 |
"name" => "weekly_days_of_week_to_repeat", |
| 99 |
"display" => "none", |
| 100 |
"title" => __( "Repeat On The Following Days", 'timed-content' ), |
| 101 |
"description" => __( "If the frequency is set to Weekly, repeat this action on these days of the week INSTEAD of the day of week the Starting Date/Time falls on.", 'timed-content' ), |
| 102 |
"type" => "checkbox-list", |
| 103 |
"default" => array(), |
| 104 |
"values" => $timed_content_rule_days_array, |
| 105 |
"scope" => array( TIMED_CONTENT_RULE_TYPE ), |
| 106 |
"capability" => "edit_posts" |
| 107 |
), |
| 108 |
array( |
| 109 |
"name" => "monthly_num_of_months", |
| 110 |
"display" => "none", |
| 111 |
"title" => __( "Repeat How Often?", 'timed-content' ), |
| 112 |
"description" => __( "If the frequency is set to Monthly, repeat this action every X months.", 'timed-content' ), |
| 113 |
"type" => "number", |
| 114 |
"default" => "1", |
| 115 |
"min" => "1", |
| 116 |
"scope" => array( TIMED_CONTENT_RULE_TYPE ), |
| 117 |
"capability" => "edit_posts" |
| 118 |
), |
| 119 |
array( |
| 120 |
"name" => "monthly_nth_weekday_of_month", |
| 121 |
"display" => "none", |
| 122 |
"title" => __( "Repeat On The Nth Weekday Of The Month?", 'timed-content' ), |
| 123 |
"description" => __( "If the frequency is set to Monthly, repeat this action on the Nth weekday of the month (i.e., every third Tuesday). Check this box to select a pattern below.", 'timed-content' ), |
| 124 |
"type" => "checkbox", |
| 125 |
"default" => "no", |
| 126 |
"scope" => array( TIMED_CONTENT_RULE_TYPE ), |
| 127 |
"capability" => "edit_posts" |
| 128 |
), |
| 129 |
array( |
| 130 |
"name" => "monthly_nth_weekday_of_month_nth", |
| 131 |
"display" => "none", |
| 132 |
"title" => __( "Nth Weekday Ordinal:", 'timed-content' ), |
| 133 |
"description" => __( "Select a value for the Nth (i.e., 'first', 'second', etc.) week of the month.", 'timed-content' ), |
| 134 |
"type" => "list", |
| 135 |
"default" => 0, |
| 136 |
"values" => $timed_content_rule_ordinal_array, |
| 137 |
"scope" => array( TIMED_CONTENT_RULE_TYPE ), |
| 138 |
"capability" => "edit_posts" |
| 139 |
), |
| 140 |
array( |
| 141 |
"name" => "monthly_nth_weekday_of_month_weekday", |
| 142 |
"display" => "none", |
| 143 |
"title" => __( "Nth Weekday Day Of Week:", 'timed-content' ), |
| 144 |
"description" => __( "Select the day of week to repeat on.", 'timed-content' ), |
| 145 |
"type" => "list", |
| 146 |
"default" => 0, |
| 147 |
"values" => $timed_content_rule_ordinal_days_array, |
| 148 |
"scope" => array( TIMED_CONTENT_RULE_TYPE ), |
| 149 |
"capability" => "edit_posts" |
| 150 |
), |
| 151 |
array( |
| 152 |
"name" => "yearly_num_of_years", |
| 153 |
"display" => "none", |
| 154 |
"title" => __( "Repeat How Often?", 'timed-content' ), |
| 155 |
"description" => __( "If the frequency is set to Yearly, repeat this action every X years.", 'timed-content' ), |
| 156 |
"type" => "number", |
| 157 |
"default" => "1", |
| 158 |
"min" => "1", |
| 159 |
"scope" => array( TIMED_CONTENT_RULE_TYPE ), |
| 160 |
"capability" => "edit_posts" |
| 161 |
) |
| 162 |
); |
| 163 |
$timed_content_rule_recurrence_custom_fields = array( |
| 164 |
array( |
| 165 |
"name" => "recurrence_duration", |
| 166 |
"display" => "block", |
| 167 |
"title" => __( "How Often To Repeat This Action?", 'timed-content' ), |
| 168 |
"description" => "", |
| 169 |
"type" => "radio", |
| 170 |
"values" => array( "recurrence_duration_end_date" => __( "Keep repeating until a given date", 'timed-content' ), |
| 171 |
"recurrence_duration_num_repeat" => __( "Repeat a set number of times", 'timed-content' ) ), |
| 172 |
"default" => "recurrence_duration_end_date", |
| 173 |
"scope" => array( TIMED_CONTENT_RULE_TYPE ), |
| 174 |
"capability" => "edit_posts" |
| 175 |
), |
| 176 |
array( |
| 177 |
"name" => "recurrence_duration_end_date", |
| 178 |
"display" => "none", |
| 179 |
"title" => __( "End Date:", 'timed-content' ), |
| 180 |
"description" => __( "Using the settings above, repeat this action until this date.", 'timed-content' ), |
| 181 |
"type" => "date", |
| 182 |
"default" => date( "F jS, Y", strtotime( "+1 year", $now_t ) ), |
| 183 |
"scope" => array( TIMED_CONTENT_RULE_TYPE ), |
| 184 |
"capability" => "edit_posts" |
| 185 |
), |
| 186 |
array( |
| 187 |
"name" => "recurrence_duration_num_repeat", |
| 188 |
"display" => "none", |
| 189 |
"title" => __( "Repeat How Many Times?", 'timed-content' ), |
| 190 |
"description" => __( "Using the settings above, repeat this action this many times.", 'timed-content' ), |
| 191 |
"type" => "number", |
| 192 |
"default" => "1", |
| 193 |
"min" => "1", |
| 194 |
"scope" => array( TIMED_CONTENT_RULE_TYPE ), |
| 195 |
"capability" => "edit_posts" |
| 196 |
) |
| 197 |
); |
| 198 |
|
| 199 |
?> |