PluginProbe
WANotifier for Forms and Actions / 2.1.3
WANotifier for Forms and Actions v2.1.3
3.2.0 3.1.1 3.1.0 3.0.4 2.7.10 2.7.11 2.7.12 2.7.13 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 2.7.8 2.7.9 3.0.0 3.0.1 3.0.2 3.0.3 trunk 0.1.0 0.1.1 1.0.0 1.0.1 All 68 releases
← All changes | views/admin-triggers.php +9 -25 2.7.10 → 2.1.3 View file →
@@ -13,34 +13,18 @@
13 13 <div class="meta-fields">
14 14 <div class="general-fields">
15 15 <div>
16 16 <?php
17 - $main_triggers = self::get_notification_triggers();
18 - foreach ($main_triggers as $key => $triggers) {
19 - $dropdown_triggers[$key] = wp_list_pluck($triggers, 'label', 'id');
20 - }
21 - $selected_trigger = Notifier_Notification_Triggers::get_post_trigger_id($post_id);
17 + notifier_wp_select(
18 + array(
19 + 'id' => NOTIFIER_PREFIX . 'trigger',
20 + 'value' => get_post_meta( $post_id, NOTIFIER_PREFIX . 'trigger', true),
21 + 'label' => 'Select Trigger',
22 + 'description' => 'Select the trigger when you want to fire a Natification from WANotifier.com.',
23 + 'options' => Notifier_Notification_Triggers::get_notification_triggers_dropdown()
24 + )
25 + );
22 26 ?>
23 - <p class="form-field mb-3 notifier_trigger_field " data-conditions="">
24 - <label for="notifier_trigger" class="form-label">Select Trigger</label>
25 - <select class="form-select" style="" name="notifier_trigger" id="notifier_trigger">
26 - <option value="">Select trigger</option>
27 - <?php
28 - foreach ($main_triggers as $key => $triggers) {
29 - if(empty($triggers)){
30 - continue;
31 - }
32 - echo '<optgroup label="'.esc_attr($key).'">';
33 - foreach($triggers as $trigger){
34 - $selected = selected( $selected_trigger, $trigger['id'], false);
35 - echo '<option value="'.esc_attr($trigger['id']).'" title="'.esc_attr($trigger['description']).'" '.$selected.' >'.esc_attr($trigger['label']).'</option>';
36 - }
37 - echo '</optgroup>';
38 - }
39 - ?>
40 - </select>
41 - <span class="description">Select the trigger when you want to fire the Notification on WANotifier.com.</span>
42 - </p>
43 27 </div>
44 28 <?php
45 29 $send_to_conditions = array (
46 30 array (