WSP-57
This commit is contained in:
@@ -47,6 +47,7 @@ function superdesk_admin() {
|
|||||||
'convert-slugline' => $_POST['convert-slugline'],
|
'convert-slugline' => $_POST['convert-slugline'],
|
||||||
'slugline-separator' => $_POST['slugline-separator'],
|
'slugline-separator' => $_POST['slugline-separator'],
|
||||||
'slugline-ignored' => $_POST['slugline-ignored'],
|
'slugline-ignored' => $_POST['slugline-ignored'],
|
||||||
|
'priority_threshhold' => $_POST['priority_threshhold'],
|
||||||
);
|
);
|
||||||
update_option('superdesk_settings', $settings);
|
update_option('superdesk_settings', $settings);
|
||||||
} else if (get_option('superdesk_settings')) {
|
} else if (get_option('superdesk_settings')) {
|
||||||
@@ -74,6 +75,7 @@ function superdesk_admin() {
|
|||||||
'convert-slugline' => '',
|
'convert-slugline' => '',
|
||||||
'slugline-separator' => '',
|
'slugline-separator' => '',
|
||||||
'slugline-ignored' => '',
|
'slugline-ignored' => '',
|
||||||
|
'priority_threshhold' => '',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
$statuses = array(
|
$statuses = array(
|
||||||
@@ -441,6 +443,27 @@ function superdesk_admin() {
|
|||||||
<input type="text" name="slugline-ignored" id="slugline-ignored" class="regular-text" value="<?php echo($settings['slugline-ignored']); ?>">
|
<input type="text" name="slugline-ignored" id="slugline-ignored" class="regular-text" value="<?php echo($settings['slugline-ignored']); ?>">
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">
|
||||||
|
<label for="priority_threshhold">Priority threshhold of </label>
|
||||||
|
</th>
|
||||||
|
<td>
|
||||||
|
<select name="priority_threshhold" id="priority_threshhold">
|
||||||
|
<option value="0"> </option>
|
||||||
|
<?php
|
||||||
|
for ($i = 1; $i <= 6; $i++) {
|
||||||
|
?>
|
||||||
|
<option value="<?php echo($i); ?>"<?php
|
||||||
|
if (isset($settings['priority_threshhold']) && $settings['priority_threshhold'] == $i) {
|
||||||
|
echo(' selected');
|
||||||
|
}
|
||||||
|
?>><?php echo($i); ?></option>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<p class="submit">
|
<p class="submit">
|
||||||
|
|||||||
10
autoload.php
10
autoload.php
@@ -154,6 +154,12 @@ if ($obj['type'] == 'text') {
|
|||||||
'time' => current_time('mysql')
|
'time' => current_time('mysql')
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if ($settings['priority_threshhold'] && $settings['priority_threshhold'] >= $obj['priority']) {
|
||||||
|
stick_post($post_ID);
|
||||||
|
} else {
|
||||||
|
unstick_post($post_ID);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$postarr = array(
|
$postarr = array(
|
||||||
'post_title' => wp_strip_all_tags($obj['headline']),
|
'post_title' => wp_strip_all_tags($obj['headline']),
|
||||||
@@ -180,6 +186,10 @@ if ($obj['type'] == 'text') {
|
|||||||
'time' => current_time('mysql')
|
'time' => current_time('mysql')
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if ($settings['priority_threshhold'] && $settings['priority_threshhold'] >= $obj['priority']) {
|
||||||
|
stick_post($post_ID);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* save featured media */
|
/* save featured media */
|
||||||
|
|||||||
Reference in New Issue
Block a user