WhatsApp Chat WP - Version 4.6.1

Version Description

Hello! We've recently acquired this plugin and included tons of new features.

Download this release

Release Info

Developer quadlayers
Plugin Icon 128x128 WhatsApp Chat WP
Version 4.6.1
Comparing to
See all releases

Code changes from version 4.6.0 to 4.6.1

assets/backend/js/qlwapp-admin.js CHANGED
@@ -70,8 +70,8 @@
70
  var options = [];
71
 
72
  if (response) {
73
- $.each(response, function (index, text) {
74
- options.push({id: text[0], text: text[1]});
75
  });
76
  }
77
  return {
70
  var options = [];
71
 
72
  if (response) {
73
+ $.each(response, function (id, title) {
74
+ options.push({id: id, text: title});
75
  });
76
  }
77
  return {
assets/backend/js/qlwapp-admin.min.js CHANGED
@@ -1,2 +1,2 @@
1
 
2
- (function(b){function a(c){if(c){b("#submit").attr("disabled",true)}else{b("#submit").attr("disabled",false)}}a(true);b("form").change(function(c){a(false)});b(".button").click(function(){a(false)});b("button").click(function(){a(false)});b(".qlwapp-color-field").wpColorPicker({change:function(c,d){a(false)},clear:function(c,d){a(false)},});b(document).on("tinymce_change",function(c){a(false)});b(document).on("qlwapp-enhanced-select",function(c){b(".qlwapp-select2").filter(":not(.enhanced)").each(function(){var d={allowClear:false,theme:"default",minimumResultsForSearch:-1};b(this).select2(d).addClass("enhanced")});b(".qlwapp-select2-search").filter(":not(.enhanced)").each(function(){var e=b(this),d=b(this).data("name");var f={allowClear:true,ajax:{url:ajaxurl,dataType:"json",data:function(g){return{name:d,per_page:10,q:g.term||0,selected:e.select2("val")||0,action:"qlwapp_get_posts",nonce:qlwapp.nonce.qlwapp_get_posts}},processResults:function(g){var h=[];if(g){b.each(g,function(i,j){h.push({id:j[0],text:j[1]})})}return{results:h}},cache:true},minimumInputLength:3};b(this).select2(f).addClass("enhanced")})}).trigger("qlwapp-enhanced-select");b(".qlwapp-color-field").wpColorPicker();b(document).on("click",".upload_image_button",function(f){f.preventDefault();var c=wp.media.editor.send.attachment,d=b(this);wp.media.editor.send.attachment=function(e,g){b(d).parent().prev().attr("src",g.url);b(d).prev().val(g.url).trigger("change");wp.media.editor.send.attachment=c};wp.media.editor.open(d);return false});b(document).on("click",".remove_image_button",function(c){c.preventDefault();var d=b(this).parent().prev().attr("data-src");b(this).parent().prev().attr("src",d);b(this).prev().prev().val("").trigger("change");return false});b(document).on("qlwapp.save","form",function(i,h,f){var c=b(i.currentTarget),g=c.find(".settings-save-status .spinner"),d=c.find(".settings-save-status .saved");b.ajax({url:ajaxurl,data:{action:h,nonce:f,form_data:c.serialize()},dataType:"json",type:"POST",beforeSend:function(){a(true);g.addClass("is-active")},complete:function(){g.removeClass("is-active")},error:function(e){console.log(e)},success:function(e){d.addClass("is-active");if(e.success){setTimeout(function(){d.removeClass("is-active")},2000);console.log(e.data)}else{alert(e.data)}}});return false});b(document).on("submit","#qlwapp_button_form",function(f){f.preventDefault();var c=b(this),d=c.find("#qlwapp_button_form_nonce").val();c.trigger("qlwapp.save",["qlwapp_save_button",d])});b(document).on("submit","#qlwapp_box_form",function(f){f.preventDefault();var c=b(this),d=c.find("#qlwapp_box_form_nonce").val();c.trigger("qlwapp.save",["qlwapp_save_box",d])});b(document).on("submit","#qlwapp_display_form",function(f){f.preventDefault();var c=b(this),d=c.find("#qlwapp_display_form_nonce").val();c.trigger("qlwapp.save",["qlwapp_save_display",d])});b(document).on("submit","#qlwapp_scheme_form",function(f){f.preventDefault();var c=b(this),d=c.find("#qlwapp_scheme_form_nonce").val();c.trigger("qlwapp.save",["qlwapp_save_scheme",d])})})(jQuery);
1
 
2
+ (function(b){function a(c){if(c){b("#submit").attr("disabled",true)}else{b("#submit").attr("disabled",false)}}a(true);b("form").change(function(c){a(false)});b(".button").click(function(){a(false)});b("button").click(function(){a(false)});b(".qlwapp-color-field").wpColorPicker({change:function(c,d){a(false)},clear:function(c,d){a(false)},});b(document).on("tinymce_change",function(c){a(false)});b(document).on("qlwapp-enhanced-select",function(c){b(".qlwapp-select2").filter(":not(.enhanced)").each(function(){var d={allowClear:false,theme:"default",minimumResultsForSearch:-1};b(this).select2(d).addClass("enhanced")});b(".qlwapp-select2-search").filter(":not(.enhanced)").each(function(){var e=b(this),d=b(this).data("name");var f={allowClear:true,ajax:{url:ajaxurl,dataType:"json",data:function(g){return{name:d,per_page:10,q:g.term||0,selected:e.select2("val")||0,action:"qlwapp_get_posts",nonce:qlwapp.nonce.qlwapp_get_posts}},processResults:function(g){var h=[];if(g){b.each(g,function(j,i){console.log("id",j);console.log("title",i);h.push({id:j,text:i})})}return{results:h}},cache:true},minimumInputLength:3};b(this).select2(f).addClass("enhanced")})}).trigger("qlwapp-enhanced-select");b(".qlwapp-color-field").wpColorPicker();b(document).on("click",".upload_image_button",function(f){f.preventDefault();var c=wp.media.editor.send.attachment,d=b(this);wp.media.editor.send.attachment=function(e,g){b(d).parent().prev().attr("src",g.url);b(d).prev().val(g.url).trigger("change");wp.media.editor.send.attachment=c};wp.media.editor.open(d);return false});b(document).on("click",".remove_image_button",function(c){c.preventDefault();var d=b(this).parent().prev().attr("data-src");b(this).parent().prev().attr("src",d);b(this).prev().prev().val("").trigger("change");return false});b(document).on("qlwapp.save","form",function(i,h,f){var c=b(i.currentTarget),g=c.find(".settings-save-status .spinner"),d=c.find(".settings-save-status .saved");b.ajax({url:ajaxurl,data:{action:h,nonce:f,form_data:c.serialize()},dataType:"json",type:"POST",beforeSend:function(){a(true);g.addClass("is-active")},complete:function(){g.removeClass("is-active")},error:function(e){console.log(e)},success:function(e){d.addClass("is-active");if(e.success){setTimeout(function(){d.removeClass("is-active")},2000);console.log(e.data)}else{alert(e.data)}}});return false});b(document).on("submit","#qlwapp_button_form",function(f){f.preventDefault();var c=b(this),d=c.find("#qlwapp_button_form_nonce").val();c.trigger("qlwapp.save",["qlwapp_save_button",d])});b(document).on("submit","#qlwapp_box_form",function(f){f.preventDefault();var c=b(this),d=c.find("#qlwapp_box_form_nonce").val();c.trigger("qlwapp.save",["qlwapp_save_box",d])});b(document).on("submit","#qlwapp_display_form",function(f){f.preventDefault();var c=b(this),d=c.find("#qlwapp_display_form_nonce").val();c.trigger("qlwapp.save",["qlwapp_save_display",d])});b(document).on("submit","#qlwapp_scheme_form",function(f){f.preventDefault();var c=b(this),d=c.find("#qlwapp_scheme_form_nonce").val();c.trigger("qlwapp.save",["qlwapp_save_scheme",d])})})(jQuery);
changelog.txt CHANGED
@@ -1,3 +1,10 @@
 
 
 
 
 
 
 
1
  = 4.5.9 =
2
  * Fix. small css issues
3
 
1
+ = 4.6.1 =
2
+ * Fix. save entries in display contact
3
+ * Fix. save taxonomies in display contact
4
+
5
+ = 4.6.0 =
6
+ * Fix. small css issues
7
+
8
  = 4.5.9 =
9
  * Fix. small css issues
10
 
includes/backend.php CHANGED
@@ -5,7 +5,6 @@ class QLWAPP_Admin {
5
  protected static $instance;
6
 
7
  function init() {
8
- add_action('wp_ajax_qlwapp_get_posts', array($this, 'ajax_get_posts'));
9
  add_filter('default_option_qlwapp', array($this, 'generate_db'));
10
  add_filter('sanitize_option_qlwapp', 'wp_unslash');
11
  add_action('admin_enqueue_scripts', array($this, 'add_js'));
@@ -60,42 +59,7 @@ class QLWAPP_Admin {
60
  'qlwapp_get_posts' => wp_create_nonce('qlwapp_get_posts'),
61
  )));
62
  }
63
- }
64
- /// pasarlo al controlador de display
65
- function ajax_get_posts() {
66
-
67
- if (current_user_can('manage_options')) {
68
-
69
- if (!empty($_REQUEST) && check_admin_referer('qlwapp_get_posts', 'nonce')) {
70
-
71
- $data = array(
72
- array('all', esc_html__('all', 'wp-whatsapp-chat'))
73
- );
74
-
75
- $args = array(
76
- 'post_type' => sanitize_key($_REQUEST['name']),
77
- 'post_status' => 'publish',
78
- 'ignore_sticky_posts' => 1,
79
- 'posts_per_page' => 10,
80
- 'exclude' => array_map('intval', (array) $_REQUEST['selected'])
81
- );
82
-
83
- if ($_REQUEST['q']) {
84
- $args['s'] = sanitize_text_field($_REQUEST['q']);
85
- }
86
-
87
- $posts = get_posts($args);
88
-
89
- foreach ($posts as $post) {
90
- $data[] = array($post->ID, mb_substr($post->post_title, 0, 49));
91
- }
92
-
93
- wp_send_json($data);
94
- }
95
- }
96
-
97
- wp_die();
98
- }
99
 
100
  public static function instance() {
101
  if (!isset(self::$instance)) {
5
  protected static $instance;
6
 
7
  function init() {
 
8
  add_filter('default_option_qlwapp', array($this, 'generate_db'));
9
  add_filter('sanitize_option_qlwapp', 'wp_unslash');
10
  add_action('admin_enqueue_scripts', array($this, 'add_js'));
59
  'qlwapp_get_posts' => wp_create_nonce('qlwapp_get_posts'),
60
  )));
61
  }
62
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
 
64
  public static function instance() {
65
  if (!isset(self::$instance)) {
includes/controllers/ContactController.php CHANGED
@@ -6,164 +6,183 @@ include_once(QLWAPP_PLUGIN_DIR . 'includes/controllers/QLWAPP_Controller.php');
6
 
7
  class QLWAPP_Contact_Controller extends QLWAPP_Controller {
8
 
9
- protected static $instance;
10
-
11
- function add_menu() {
12
- add_submenu_page(QLWAPP_DOMAIN, esc_html__('Contacts', 'wp-whatsapp-chat'), esc_html__('Contacts', 'wp-whatsapp-chat'), 'manage_options', QLWAPP_DOMAIN . '_contacts', array($this, 'add_panel'));
13
- }
14
-
15
- function add_panel() {
16
- global $submenu;
17
- $contact_model = new QLWAPP_Contact();
18
- $contact_visibility = new Display_Component();
19
- $contacts = $contact_model->get_contacts_reorder();
20
-
21
- $contact_args = $contact_model->get_args();
22
- $contact_entries = $contact_visibility->get_entries();
23
- $contact_taxonomies = $contact_visibility->get_taxonomies();
24
- include (QLWAPP_PLUGIN_DIR . '/includes/view/backend/pages/parts/header.php');
25
- include (QLWAPP_PLUGIN_DIR . '/includes/view/backend/pages/contacts.php');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  }
27
 
28
- function get_contact($contact_id) {
 
 
29
 
30
- function get_the_title1($id) {
31
- return ($id == 'all') ? esc_html__('All', 'wp-whatsapp-chat') : get_the_title($id);
 
32
  }
33
-
34
- $contact_model = new QLWAPP_Contact();
35
- $contact = $contact_model->get_contact($contact_id);
36
- foreach ($contact['display']['entries'] as $key => $value) {
37
- $type = get_post_type_object($key);
38
- $contact ['display']['entries'][$key]['ids'] = array_filter(array_combine((array) $value['ids'], array_map('get_the_title1', (array) $value['ids'])));
39
- }
40
- foreach ($contact['display']['taxonomies'] as $key => $value) {
41
- $contact ['display']['taxonomies'][$key]['ids'] = array_filter(array_combine((array) $value['ids'], array_map('get_the_title1', (array) $value['ids'])));
42
  }
 
43
 
44
- return $contact;
45
  }
46
 
47
- function ajax_edit_contact() {
48
- if (check_ajax_referer('qlwapp_edit_contact', 'nonce', false)) {
49
- $contact_id = (isset($_REQUEST['contact_id'])) ? absint($_REQUEST['contact_id']) : -1;
50
- if ($contact_id != -1) {
51
- $contact = $this->get_contact($contact_id);
52
- if ($contact) {
53
- return parent::success_ajax($contact);
54
- }
55
- } else {
56
- return parent::success_ajax(-1);
57
- }
58
- /// parent::error_reload_page();
59
  }
60
- parent::error_access_denied();
 
 
 
61
  }
 
 
62
 
63
- function ajax_save_contact() {
64
-
65
- if (current_user_can('manage_options')) {
66
- if (check_ajax_referer('qlwapp_save_contact', 'nonce', false) && isset($_REQUEST['contact_data'])) {
67
- $contact_data = array();
68
- parse_str($_REQUEST['contact_data'], $contact_data);
69
- $contact_model = new QLWAPP_Contact();
70
- if (is_array($contact_data)) {
71
- if (isset($contact_data['id'])) {
72
- return parent::success_save($contact_model->update_contact($contact_data));
73
- } else {
74
- return parent::success_save($contact_model->add_contact($contact_data));
75
- }
76
- return parent::error_reload_page();
77
- }
78
- }
79
- return parent::error_access_denied();
80
  }
 
 
81
  }
82
-
83
- function ajax_save_contact_order() {
84
- if (current_user_can('manage_options')) {
85
- if (check_ajax_referer('qlwapp_save_contact_order', 'nonce', false) && isset($_REQUEST['contact_data'])) {
86
- if (array_key_exists('contact_data', $_REQUEST)) {
87
- $contact_model = new QLWAPP_Contact();
88
- $contacts = $contact_model->get_contacts();
89
- $contact_order = array();
90
- parse_str($_REQUEST['contact_data'], $contact_order);
91
- $contacts_id = $contact_order['contact_id'];
92
- $result = -1;
93
- if (is_array($contacts_id) && count($contacts_id) > 0) {
94
- $loop = 1;
95
- foreach ($contacts_id as $contact_id) {
96
- if (isset($contacts[$contact_id])) {
97
- $contacts[$contact_id]['order'] = $loop;
98
- $loop++;
99
- }
100
- }
101
- $result = $contact_model->update_contacts($contacts);
102
- }
103
- }
104
  }
105
- return wp_send_json_success($result);
 
106
  }
 
 
107
  }
 
108
 
109
- function ajax_delete_contact() {
110
 
111
- if (check_ajax_referer('qlwapp_delete_contact', 'nonce', false)) {
112
 
113
- $contact_id = (isset($_REQUEST['contact_id'])) ? absint($_REQUEST['contact_id']) : -1;
114
 
115
- $contact_model = new QLWAPP_Contact();
116
 
117
- $contact = $contact_model->delete($contact_id);
118
- if ($contact_id) {
119
 
120
- return parent::success_ajax($contact);
121
- }
122
- parent::error_reload_page();
123
- }
124
- parent::error_access_denied();
125
  }
126
-
127
- function init() {
128
-
129
- add_action('wp_ajax_qlwapp_add_contact', array($this, 'ajax_add_contact'));
130
- add_action('wp_ajax_qlwapp_edit_contact', array($this, 'ajax_edit_contact'));
131
- add_action('wp_ajax_qlwapp_save_contact', array($this, 'ajax_save_contact'));
132
- add_action('wp_ajax_qlwapp_delete_contact', array($this, 'ajax_delete_contact'));
133
- add_action('wp_ajax_qlwapp_save_contact_order', array($this, 'ajax_save_contact_order'));
134
- add_action('admin_enqueue_scripts', array($this, 'add_js'));
135
- add_action('admin_menu', array($this, 'add_menu'));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
136
  }
 
137
 
138
- function add_js() {
139
- if (isset($_GET['page']) && ($_GET['page'] === 'qlwapp_contacts')) {
140
- $contact_model = new QLWAPP_Contact();
141
- wp_enqueue_media();
142
- wp_enqueue_script('qlwapp-admin-contact', plugins_url('/assets/backend/js/qlwapp-admin-contact' . QLWAPP::is_min() . '.js', QLWAPP_PLUGIN_FILE), array('wp-util', 'jquery', 'backbone'), QLWAPP_PLUGIN_VERSION, true);
143
-
144
- wp_localize_script('qlwapp-admin-contact', 'qlwapp_contact', array(
145
- 'nonce' => array(
146
- 'qlwapp_get_contact' => wp_create_nonce('qlwapp_get_contact'),
147
- 'qlwapp_edit_contact' => wp_create_nonce('qlwapp_edit_contact'),
148
- 'qlwapp_add_contact' => wp_create_nonce('qlwapp_add_contact'),
149
- 'qlwapp_save_contact' => wp_create_nonce('qlwapp_save_contact'),
150
- 'qlwapp_save_contact_order' => wp_create_nonce('qlwapp_save_contact_order')
151
- ),
152
- 'message' => array(
153
- 'contact_confirm_delete' => 'you want to delete the contact',
154
- 'contact_confirm_delete_title' => 'Contact: confirmation'
155
- ),
156
- 'args' => $contact_model->get_args()));
157
- }
158
- }
159
-
160
- public static function instance() {
161
- if (!isset(self::$instance)) {
162
- self::$instance = new self();
163
- self::$instance->init();
164
- }
165
- return self::$instance;
166
  }
 
 
167
 
168
  }
169
 
6
 
7
  class QLWAPP_Contact_Controller extends QLWAPP_Controller {
8
 
9
+ protected static $instance;
10
+
11
+ function add_menu() {
12
+ add_submenu_page(QLWAPP_DOMAIN, esc_html__('Contacts', 'wp-whatsapp-chat'), esc_html__('Contacts', 'wp-whatsapp-chat'), 'manage_options', QLWAPP_DOMAIN . '_contacts', array($this, 'add_panel'));
13
+ }
14
+
15
+ function add_panel() {
16
+ global $submenu;
17
+ $contact_model = new QLWAPP_Contact();
18
+ $contact_visibility = new Display_Component();
19
+ $contacts = $contact_model->get_contacts_reorder();
20
+
21
+ $contact_args = $contact_model->get_args();
22
+ $contact_entries = $contact_visibility->get_entries();
23
+ $contact_taxonomies = $contact_visibility->get_taxonomies();
24
+ include (QLWAPP_PLUGIN_DIR . '/includes/view/backend/pages/parts/header.php');
25
+ include (QLWAPP_PLUGIN_DIR . '/includes/view/backend/pages/contacts.php');
26
+ }
27
+
28
+ function get_contact($contact_id) {
29
+
30
+ $contact_model = new QLWAPP_Contact();
31
+ $contact = $contact_model->get_contact($contact_id);
32
+
33
+ foreach ($contact['display']['entries'] as $key => $value) {
34
+ $_entries_titles = array();
35
+ foreach ((array) $value['ids'] as $id) {
36
+ if ($id == 'all') {
37
+ $_entries_titles[$id] = esc_html__('All', 'wp-whatsapp-chat');
38
+ continue;
39
+ }
40
+ if ($title = get_the_title(absint($id))) {
41
+ $_entries_titles[$id] = $title;
42
+ }
43
+ }
44
+ $contact['display']['entries'][$key]['ids'] = $_entries_titles;
45
  }
46
 
47
+ foreach ($contact['display']['taxonomies'] as $key => $value) {
48
+ $_taxonomies_titles = array();
49
+ foreach ($value['ids'] as $id) {
50
 
51
+ if ($id == 'all') {
52
+ $_taxonomies_titles[$id] = esc_html__('All', 'wp-whatsapp-chat');
53
+ continue;
54
  }
55
+ if ($term = get_term_by('id', absint($id), $key)) {
56
+ $_taxonomies_titles[$id] = $term->name;
 
 
 
 
 
 
 
57
  }
58
+ }
59
 
60
+ $contact['display']['taxonomies'][$key]['ids'] = $_taxonomies_titles;
61
  }
62
 
63
+ return $contact;
64
+ }
65
+
66
+ function ajax_edit_contact() {
67
+ if (check_ajax_referer('qlwapp_edit_contact', 'nonce', false)) {
68
+ $contact_id = (isset($_REQUEST['contact_id'])) ? absint($_REQUEST['contact_id']) : -1;
69
+ if ($contact_id != -1) {
70
+ $contact = $this->get_contact($contact_id);
71
+ if ($contact) {
72
+ return parent::success_ajax($contact);
 
 
73
  }
74
+ } else {
75
+ return parent::success_ajax(-1);
76
+ }
77
+ /// parent::error_reload_page();
78
  }
79
+ parent::error_access_denied();
80
+ }
81
 
82
+ function ajax_save_contact() {
83
+
84
+ if (current_user_can('manage_options')) {
85
+ if (check_ajax_referer('qlwapp_save_contact', 'nonce', false) && isset($_REQUEST['contact_data'])) {
86
+ $contact_data = array();
87
+ parse_str($_REQUEST['contact_data'], $contact_data);
88
+ $contact_model = new QLWAPP_Contact();
89
+ if (is_array($contact_data)) {
90
+ if (isset($contact_data['id'])) {
91
+ return parent::success_save($contact_model->update_contact($contact_data));
92
+ } else {
93
+ return parent::success_save($contact_model->add_contact($contact_data));
94
+ }
95
+ return parent::error_reload_page();
 
 
 
96
  }
97
+ }
98
+ return parent::error_access_denied();
99
  }
100
+ }
101
+
102
+ function ajax_save_contact_order() {
103
+ if (current_user_can('manage_options')) {
104
+ if (check_ajax_referer('qlwapp_save_contact_order', 'nonce', false) && isset($_REQUEST['contact_data'])) {
105
+ if (array_key_exists('contact_data', $_REQUEST)) {
106
+ $contact_model = new QLWAPP_Contact();
107
+ $contacts = $contact_model->get_contacts();
108
+ $contact_order = array();
109
+ parse_str($_REQUEST['contact_data'], $contact_order);
110
+ $contacts_id = $contact_order['contact_id'];
111
+ $result = -1;
112
+ if (is_array($contacts_id) && count($contacts_id) > 0) {
113
+ $loop = 1;
114
+ foreach ($contacts_id as $contact_id) {
115
+ if (isset($contacts[$contact_id])) {
116
+ $contacts[$contact_id]['order'] = $loop;
117
+ $loop++;
118
+ }
 
 
 
119
  }
120
+ $result = $contact_model->update_contacts($contacts);
121
+ }
122
  }
123
+ }
124
+ return wp_send_json_success($result);
125
  }
126
+ }
127
 
128
+ function ajax_delete_contact() {
129
 
130
+ if (check_ajax_referer('qlwapp_delete_contact', 'nonce', false)) {
131
 
132
+ $contact_id = (isset($_REQUEST['contact_id'])) ? absint($_REQUEST['contact_id']) : -1;
133
 
134
+ $contact_model = new QLWAPP_Contact();
135
 
136
+ $contact = $contact_model->delete($contact_id);
137
+ if ($contact_id) {
138
 
139
+ return parent::success_ajax($contact);
140
+ }
141
+ parent::error_reload_page();
 
 
142
  }
143
+ parent::error_access_denied();
144
+ }
145
+
146
+ function init() {
147
+
148
+ add_action('wp_ajax_qlwapp_add_contact', array($this, 'ajax_add_contact'));
149
+ add_action('wp_ajax_qlwapp_edit_contact', array($this, 'ajax_edit_contact'));
150
+ add_action('wp_ajax_qlwapp_save_contact', array($this, 'ajax_save_contact'));
151
+ add_action('wp_ajax_qlwapp_delete_contact', array($this, 'ajax_delete_contact'));
152
+ add_action('wp_ajax_qlwapp_save_contact_order', array($this, 'ajax_save_contact_order'));
153
+ add_action('admin_enqueue_scripts', array($this, 'add_js'));
154
+ add_action('admin_menu', array($this, 'add_menu'));
155
+ }
156
+
157
+ function add_js() {
158
+ if (isset($_GET['page']) && ($_GET['page'] === 'qlwapp_contacts')) {
159
+ $contact_model = new QLWAPP_Contact();
160
+ wp_enqueue_media();
161
+ wp_enqueue_script('qlwapp-admin-contact', plugins_url('/assets/backend/js/qlwapp-admin-contact' . QLWAPP::is_min() . '.js', QLWAPP_PLUGIN_FILE), array('wp-util', 'jquery', 'backbone'), QLWAPP_PLUGIN_VERSION, true);
162
+
163
+ wp_localize_script('qlwapp-admin-contact', 'qlwapp_contact', array(
164
+ 'nonce' => array(
165
+ 'qlwapp_get_contact' => wp_create_nonce('qlwapp_get_contact'),
166
+ 'qlwapp_edit_contact' => wp_create_nonce('qlwapp_edit_contact'),
167
+ 'qlwapp_add_contact' => wp_create_nonce('qlwapp_add_contact'),
168
+ 'qlwapp_save_contact' => wp_create_nonce('qlwapp_save_contact'),
169
+ 'qlwapp_save_contact_order' => wp_create_nonce('qlwapp_save_contact_order')
170
+ ),
171
+ 'message' => array(
172
+ 'contact_confirm_delete' => 'you want to delete the contact',
173
+ 'contact_confirm_delete_title' => 'Contact: confirmation'
174
+ ),
175
+ 'args' => $contact_model->get_args()));
176
  }
177
+ }
178
 
179
+ public static function instance() {
180
+ if (!isset(self::$instance)) {
181
+ self::$instance = new self();
182
+ self::$instance->init();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
183
  }
184
+ return self::$instance;
185
+ }
186
 
187
  }
188
 
includes/controllers/DisplayController.php CHANGED
@@ -6,50 +6,84 @@ include_once(QLWAPP_PLUGIN_DIR . 'includes/controllers/QLWAPP_Controller.php');
6
 
7
  class QLWAPP_Display_Controller extends QLWAPP_Controller {
8
 
9
- protected static $instance;
10
 
11
- function add_menu() {
12
- add_submenu_page(QLWAPP_DOMAIN, esc_html__('Display', 'wp-whatsapp-chat'), esc_html__('Display', 'wp-whatsapp-chat'), 'manage_options', QLWAPP_DOMAIN . '_display', array($this, 'add_panel'));
13
- }
14
 
15
- function add_panel() {
16
- global $submenu;
17
- $display_model = new QLWAPP_Display();
18
- $display = $display_model->get();
19
- $visibility_component = new Display_Component();
20
- $post_types = $visibility_component->get_entries();
21
- $taxonomies = $visibility_component->get_taxonomies();
22
- include (QLWAPP_PLUGIN_DIR . '/includes/view/backend/pages/parts/header.php');
23
- include (QLWAPP_PLUGIN_DIR . '/includes/view/backend/pages/display.php');
24
- }
25
 
26
- function init() {
27
- add_action('wp_ajax_qlwapp_save_display', array($this, 'ajax_qlwapp_save_display'));
28
- add_action('admin_menu', array($this, 'add_menu'));
29
- }
 
30
 
31
- public function ajax_qlwapp_save_display() {
32
- $display_model = new QLWAPP_Display();
33
- if (current_user_can('manage_options')) {
34
- if (check_ajax_referer('qlwapp_save_display', 'nonce', false) && isset($_REQUEST['form_data'])) {
35
- $form_data = array();
36
- parse_str($_REQUEST['form_data'], $form_data);
37
- if (is_array($form_data)) {
38
- $display_model->save($form_data);
39
- return parent::success_save($form_data);
40
- }
41
- return parent::error_reload_page();
42
- }
43
- return parent::error_access_denied();
44
  }
 
 
 
45
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
 
47
- public static function instance() {
48
- if (!isset(self::$instance)) {
49
- self::$instance = new self();
50
- self::$instance->init();
51
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  }
 
53
 
54
  }
55
 
6
 
7
  class QLWAPP_Display_Controller extends QLWAPP_Controller {
8
 
9
+ protected static $instance;
10
 
11
+ function add_menu() {
12
+ add_submenu_page(QLWAPP_DOMAIN, esc_html__('Display', 'wp-whatsapp-chat'), esc_html__('Display', 'wp-whatsapp-chat'), 'manage_options', QLWAPP_DOMAIN . '_display', array($this, 'add_panel'));
13
+ }
14
 
15
+ function add_panel() {
16
+ global $submenu;
17
+ $display_model = new QLWAPP_Display();
18
+ $display = $display_model->get();
19
+ $visibility_component = new Display_Component();
20
+ $post_types = $visibility_component->get_entries();
21
+ $taxonomies = $visibility_component->get_taxonomies();
22
+ include (QLWAPP_PLUGIN_DIR . '/includes/view/backend/pages/parts/header.php');
23
+ include (QLWAPP_PLUGIN_DIR . '/includes/view/backend/pages/display.php');
24
+ }
25
 
26
+ function init() {
27
+ add_action('wp_ajax_qlwapp_get_posts', array($this, 'ajax_get_posts'));
28
+ add_action('wp_ajax_qlwapp_save_display', array($this, 'ajax_qlwapp_save_display'));
29
+ add_action('admin_menu', array($this, 'add_menu'));
30
+ }
31
 
32
+ function ajax_qlwapp_save_display() {
33
+ $display_model = new QLWAPP_Display();
34
+ if (current_user_can('manage_options')) {
35
+ if (check_ajax_referer('qlwapp_save_display', 'nonce', false) && isset($_REQUEST['form_data'])) {
36
+ $form_data = array();
37
+ parse_str($_REQUEST['form_data'], $form_data);
38
+ if (is_array($form_data)) {
39
+ $display_model->save($form_data);
40
+ return parent::success_save($form_data);
 
 
 
 
41
  }
42
+ return parent::error_reload_page();
43
+ }
44
+ return parent::error_access_denied();
45
  }
46
+ }
47
+
48
+ function ajax_get_posts() {
49
+
50
+ if (current_user_can('manage_options')) {
51
+
52
+ if (!empty($_REQUEST) && check_admin_referer('qlwapp_get_posts', 'nonce')) {
53
+
54
+ $data = array('all' => esc_html__('All this is a test', 'wp-whatsapp-chat'));
55
+
56
+ $args = array(
57
+ 'post_type' => sanitize_key($_REQUEST['name']),
58
+ 'post_status' => 'publish',
59
+ 'ignore_sticky_posts' => 1,
60
+ 'posts_per_page' => 10,
61
+ 'exclude' => array_map('intval', (array) $_REQUEST['selected'])
62
+ );
63
 
64
+ if ($_REQUEST['q']) {
65
+ $args['s'] = sanitize_text_field($_REQUEST['q']);
 
 
66
  }
67
+
68
+ $posts = get_posts($args);
69
+
70
+ foreach ($posts as $post) {
71
+ $data[$post->ID] = mb_substr($post->post_title, 0, 49);
72
+ }
73
+
74
+ wp_send_json($data);
75
+ }
76
+ }
77
+
78
+ wp_die();
79
+ }
80
+
81
+ public static function instance() {
82
+ if (!isset(self::$instance)) {
83
+ self::$instance = new self();
84
+ self::$instance->init();
85
  }
86
+ }
87
 
88
  }
89
 
includes/settings.php CHANGED
@@ -95,7 +95,9 @@ class QLWAPP_Settings {
95
  if (!isset($qlwapp['display']['target']['ids']) && isset($qlwapp['display']['target'][0])) {
96
 
97
  if ($qlwapp['display']['target'][0] == 'none') {
98
- $qlwapp['display']['target']['ids'] = array('all');
 
 
99
  $qlwapp['display']['target']['include'] = '0';
100
  } else {
101
  $qlwapp['display']['target']['ids'] = $qlwapp['display']['target'];
95
  if (!isset($qlwapp['display']['target']['ids']) && isset($qlwapp['display']['target'][0])) {
96
 
97
  if ($qlwapp['display']['target'][0] == 'none') {
98
+ $qlwapp['display']['target']['ids'] = array(
99
+ 'all' => esc_html__('All', 'wp-whatsapp-chat')
100
+ );
101
  $qlwapp['display']['target']['include'] = '0';
102
  } else {
103
  $qlwapp['display']['target']['ids'] = $qlwapp['display']['target'];
includes/view/backend/pages/contacts.php CHANGED
@@ -28,7 +28,7 @@
28
  <?php if (count($contacts)): ?>
29
  <?php
30
  $position = 1;
31
- foreach ($contacts as $id => $c) {
32
  ?>
33
  <tr class="<?php if ($position > 1) echo 'qlwapp-premium-field'; ?>" data-contact_id="<?php echo esc_attr($id) ?>" data-contact_position="<?php echo esc_attr($position) ?>">
34
  <td class="sort ui-sortable-handle">
@@ -39,16 +39,16 @@
39
  </div>
40
  </td>
41
  <td>
42
- <img class="qlwapp-avatar" src="<?php echo esc_url($c['avatar']); ?>" alt="" width="50" height="50" /> </td>
43
- <td><?php echo esc_html($c['phone']); ?></td>
44
- <td><?php echo esc_html($c['firstname'] . ', ' . $c['lastname']); ?> </td>
45
- <td><?php echo esc_html($c['label']); ?></td>
46
  <td>
47
- <i class="dashicons dashicons-<?php echo ($c['chat'] ? 'yes' : 'no'); ?>"></i>
48
  </td>
49
- <td><?php echo wp_trim_words(substr($c['message'], 0, 36), 3); ?></td>
50
- <td><?php echo sprintf('%s to %s', $c['timefrom'], $c['timeto']); ?></td>
51
- <td><?php echo esc_html($c['timezone']); ?></td>
52
  <td>
53
  <a class="qlwapp_settings_edit button" aria-label="<?php esc_html_e('Edit checkout field', 'wp-whatsapp-chat'); ?>" href="javascript:;"><?php esc_html_e('Edit'); ?></a>
54
  <a class="qlwapp_settings_delete" aria-label="<?php esc_html_e('Edit checkout field', 'wp-whatsapp-chat'); ?>" href="javascript:;"><?php esc_html_e('Delete'); ?></a>
28
  <?php if (count($contacts)): ?>
29
  <?php
30
  $position = 1;
31
+ foreach ($contacts as $id => $contact) {
32
  ?>
33
  <tr class="<?php if ($position > 1) echo 'qlwapp-premium-field'; ?>" data-contact_id="<?php echo esc_attr($id) ?>" data-contact_position="<?php echo esc_attr($position) ?>">
34
  <td class="sort ui-sortable-handle">
39
  </div>
40
  </td>
41
  <td>
42
+ <img class="qlwapp-avatar" src="<?php echo esc_url($contact['avatar']); ?>" alt="" width="50" height="50" /> </td>
43
+ <td><?php echo qlwapp_format_phone($contact['phone']); ?></td>
44
+ <td><?php echo esc_html($contact['firstname'] . ', ' . $contact['lastname']); ?> </td>
45
+ <td><?php echo esc_html($contact['label']); ?></td>
46
  <td>
47
+ <i class="dashicons dashicons-<?php echo ($contact['chat'] ? 'yes' : 'no'); ?>"></i>
48
  </td>
49
+ <td><?php echo wp_trim_words(substr($contact['message'], 0, 36), 3); ?></td>
50
+ <td><?php echo sprintf('%s to %s', $contact['timefrom'], $contact['timeto']); ?></td>
51
+ <td><?php echo esc_html($contact['timezone']); ?></td>
52
  <td>
53
  <a class="qlwapp_settings_edit button" aria-label="<?php esc_html_e('Edit checkout field', 'wp-whatsapp-chat'); ?>" href="javascript:;"><?php esc_html_e('Edit'); ?></a>
54
  <a class="qlwapp_settings_delete" aria-label="<?php esc_html_e('Edit checkout field', 'wp-whatsapp-chat'); ?>" href="javascript:;"><?php esc_html_e('Delete'); ?></a>
includes/view/backend/pages/display.php CHANGED
@@ -26,9 +26,6 @@
26
  $ids = (array) $display['target']['ids'];
27
  }
28
  ?>
29
-
30
-
31
-
32
  <select multiple="multiple" name="target[ids][]" style="width:350px" data-placeholder="<?php echo esc_attr('Choose target&hellip;', 'wp-whatsapp-chat'); ?>" aria-label="<?php echo esc_attr('Posts', 'wp-whatsapp-chat'); ?>" class="qlwapp-select2">
33
  <option value="all" <?php echo selected(true, in_array('all', $ids)); ?>><?php echo esc_html__('All', 'wp-whatsapp-chat'); ?></option>
34
  <option value="home" <?php echo selected(true, in_array('home', $ids)); ?>><?php echo esc_html__('Home', 'wp-whatsapp-chat'); ?></option>
@@ -53,10 +50,8 @@
53
  <option value="1" <?php if (isset($display['entries'][$type->name]['include']) && $display['entries'][$type->name]['include'] === '1') echo 'selected'; ?> >Include</option>
54
  <option value="0" <?php if (isset($display['entries'][$type->name]['include']) && $display['entries'][$type->name]['include'] === '0') echo 'selected'; ?> >Exclude</option>
55
  </select>
56
-
57
  <select id="qlwapp_select2_<?php echo esc_attr($type->name); ?>" multiple="multiple" name="entries[<?php echo esc_attr($type->name); ?>][ids][]" style="width:350px" data-placeholder="<?php printf(esc_html__('Select for %s&hellip;', 'wp-whatsapp-chat'), $type->label); ?>" aria-label="<?php echo esc_attr($type->label); ?>" data-name="<?php echo esc_attr($type->name); ?>" class="qlwapp-select2-search">
58
  <option value="all" <?php if (isset($display['entries'][$type->name]['ids'])) echo selected(true, in_array('all', (array) $display['entries'][$type->name]['ids'])); ?>><?php echo esc_html__('All', 'wp-whatsapp-chat'); ?></option>
59
- <!--<option value="archive" <?php // echo selected(true, in_array('archive', (array) $display['entries'][$type->name]['ids'])); ?>><?php // echo esc_html__('Archive', 'wp-whatsapp-chat'); ?></option>-->
60
  <?php
61
  // -------------------------------------------------------------
62
  // Print selected posts
@@ -98,7 +93,6 @@
98
  <tr>
99
  <th scope="row"><?php esc_html_e(ucwords($taxonomy->label)); ?></th>
100
  <td>
101
-
102
  <select style="width:80px" name="taxonomies[<?php echo esc_attr($key); ?>][include]" class="qlwapp-select2">
103
  <option value="1" <?php if (isset($display['taxonomies'][$key]['include']) && $display['taxonomies'][$key]['include'] === '1') echo 'selected'; ?> >Include</option>
104
  <option value="0" <?php if (isset($display['taxonomies'][$key]['include']) && $display['taxonomies'][$key]['include'] === '0') echo 'selected'; ?> >Exclude</option>
26
  $ids = (array) $display['target']['ids'];
27
  }
28
  ?>
 
 
 
29
  <select multiple="multiple" name="target[ids][]" style="width:350px" data-placeholder="<?php echo esc_attr('Choose target&hellip;', 'wp-whatsapp-chat'); ?>" aria-label="<?php echo esc_attr('Posts', 'wp-whatsapp-chat'); ?>" class="qlwapp-select2">
30
  <option value="all" <?php echo selected(true, in_array('all', $ids)); ?>><?php echo esc_html__('All', 'wp-whatsapp-chat'); ?></option>
31
  <option value="home" <?php echo selected(true, in_array('home', $ids)); ?>><?php echo esc_html__('Home', 'wp-whatsapp-chat'); ?></option>
50
  <option value="1" <?php if (isset($display['entries'][$type->name]['include']) && $display['entries'][$type->name]['include'] === '1') echo 'selected'; ?> >Include</option>
51
  <option value="0" <?php if (isset($display['entries'][$type->name]['include']) && $display['entries'][$type->name]['include'] === '0') echo 'selected'; ?> >Exclude</option>
52
  </select>
 
53
  <select id="qlwapp_select2_<?php echo esc_attr($type->name); ?>" multiple="multiple" name="entries[<?php echo esc_attr($type->name); ?>][ids][]" style="width:350px" data-placeholder="<?php printf(esc_html__('Select for %s&hellip;', 'wp-whatsapp-chat'), $type->label); ?>" aria-label="<?php echo esc_attr($type->label); ?>" data-name="<?php echo esc_attr($type->name); ?>" class="qlwapp-select2-search">
54
  <option value="all" <?php if (isset($display['entries'][$type->name]['ids'])) echo selected(true, in_array('all', (array) $display['entries'][$type->name]['ids'])); ?>><?php echo esc_html__('All', 'wp-whatsapp-chat'); ?></option>
 
55
  <?php
56
  // -------------------------------------------------------------
57
  // Print selected posts
93
  <tr>
94
  <th scope="row"><?php esc_html_e(ucwords($taxonomy->label)); ?></th>
95
  <td>
 
96
  <select style="width:80px" name="taxonomies[<?php echo esc_attr($key); ?>][include]" class="qlwapp-select2">
97
  <option value="1" <?php if (isset($display['taxonomies'][$key]['include']) && $display['taxonomies'][$key]['include'] === '1') echo 'selected'; ?> >Include</option>
98
  <option value="0" <?php if (isset($display['taxonomies'][$key]['include']) && $display['taxonomies'][$key]['include'] === '0') echo 'selected'; ?> >Exclude</option>
includes/view/backend/pages/modals/contact/modal-contact.php CHANGED
@@ -1,6 +1,6 @@
1
  <!--qlwapp_modal-->
2
- <div class="media-modal-backdrop">&nbsp;</div>
3
- <div tabindex="0" id="<?php echo esc_attr(QLWAPP_DOMAIN . '_modal'); ?>" class="media-modal wp-core-ui upload-php qlwapp-modal-contact processing" role="dialog" aria-modal="true" aria-labelledby="media-frame-title">
4
  <div class="media-modal-content" role="document">
5
  <form class="media-modal-form" method="POST" data-contact_id="{{data.id}}">
6
  <# if ( data.id != undefined ) { #>
@@ -23,7 +23,7 @@
23
  <div class="attachment-info">
24
  <div id="panel-info" ></div>
25
  </div>
26
- </div>
27
  </div>
28
  <div class="media-frame-toolbar" style="left:0;">
29
  <div class="media-toolbar">
1
  <!--qlwapp_modal-->
2
+ <div class="media-modal-backdrop">&nbsp;</div>
3
+ <div tabindex="0" id="<?php echo esc_attr(QLWAPP_DOMAIN . '_modal'); ?>" class="media-modal wp-core-ui upload-php qlwapp-modal-contact processing" role="dialog" aria-modal="true" aria-labelledby="media-frame-title">
4
  <div class="media-modal-content" role="document">
5
  <form class="media-modal-form" method="POST" data-contact_id="{{data.id}}">
6
  <# if ( data.id != undefined ) { #>
23
  <div class="attachment-info">
24
  <div id="panel-info" ></div>
25
  </div>
26
+ </div>
27
  </div>
28
  <div class="media-frame-toolbar" style="left:0;">
29
  <div class="media-toolbar">
includes/view/backend/pages/modals/contact/panel-contact.php CHANGED
@@ -1,4 +1,4 @@
1
- <div id="tab_panel_contact" class="panel qlwapp_options_panel " >
2
  <div class="options_group">
3
  <p class="form-field" style="
4
  width: calc(50% - 30px);
@@ -21,7 +21,7 @@
21
  float: left;
22
  ">
23
  <label><?php esc_html_e('Phone', 'wp-whatsapp-chat'); ?></label>
24
- <input type="text" name="phone" placeholder="<?php echo esc_html($contact_args['phone']); ?>" value="{{data.phone}}" required="required" pattern="\d[0-9]{6,15}$"/>
25
  </p>
26
  <p class="form-field" style="
27
  width: calc(50% - 30px);
@@ -40,13 +40,13 @@
40
  <input type="time" name="timefrom" placeholder="<?php echo esc_html($contact_args['timefrom']); ?>" value="{{data.timefrom}}" />
41
  <?php esc_html_e('To', 'wp-whatsapp-chat'); ?>
42
  <input type="time" name="timeto" placeholder="<?php echo esc_html($contact_args['timeto']); ?>" value="{{data.timeto}}" />
43
- <!-- <?php esc_html_e('Time is over', 'wp-whatsapp-chat'); ?>
44
 
45
  <select name="<?php echo esc_attr(QLWAPP_DOMAIN . '[contacts][' . $id . '][timeout]'); ?>">
46
- <option value="readonly" ><?php esc_html_e('Show the field as read only', 'wp-whatsapp-chat'); ?></option>
47
  <option value="disabled" > <?php esc_html_e('Do not show the field', 'wp-whatsapp-chat'); ?></option>
48
  </select>
49
- <p class="description hidden"><small><?php esc_html_e('This is a premium feature', 'wp-whatsapp-chat'); ?></small></p>
50
  -->
51
  </p>
52
  <p class="form-field" style="
1
+ <div id="tab_panel_contact" class="panel qlwapp_options_panel " >
2
  <div class="options_group">
3
  <p class="form-field" style="
4
  width: calc(50% - 30px);
21
  float: left;
22
  ">
23
  <label><?php esc_html_e('Phone', 'wp-whatsapp-chat'); ?></label>
24
+ <input type="text" name="phone" placeholder="<?php echo qlwapp_format_phone($contact_args['phone']); ?>" value="{{data.phone}}" required="required" pattern="\d[0-9]{6,15}$"/>
25
  </p>
26
  <p class="form-field" style="
27
  width: calc(50% - 30px);
40
  <input type="time" name="timefrom" placeholder="<?php echo esc_html($contact_args['timefrom']); ?>" value="{{data.timefrom}}" />
41
  <?php esc_html_e('To', 'wp-whatsapp-chat'); ?>
42
  <input type="time" name="timeto" placeholder="<?php echo esc_html($contact_args['timeto']); ?>" value="{{data.timeto}}" />
43
+ <!-- <?php esc_html_e('Time is over', 'wp-whatsapp-chat'); ?>
44
 
45
  <select name="<?php echo esc_attr(QLWAPP_DOMAIN . '[contacts][' . $id . '][timeout]'); ?>">
46
+ <option value="readonly" ><?php esc_html_e('Show the field as read only', 'wp-whatsapp-chat'); ?></option>
47
  <option value="disabled" > <?php esc_html_e('Do not show the field', 'wp-whatsapp-chat'); ?></option>
48
  </select>
49
+ <p class="description hidden"><small><?php esc_html_e('This is a premium feature', 'wp-whatsapp-chat'); ?></small></p>
50
  -->
51
  </p>
52
  <p class="form-field" style="
includes/view/backend/pages/modals/contact/panel-visibility.php CHANGED
@@ -21,7 +21,7 @@
21
  <select multiple="multiple" name="display[target][ids][]" data-placeholder="<?php echo esc_attr('Choose target&hellip;', 'wp-whatsapp-chat'); ?>" aria-label="<?php echo esc_attr('Posts', 'wp-whatsapp-chat'); ?>" class="qlwapp-select2">
22
  <option <# if ( _.contains(data.display.target['ids'],'all') ) { #>selected="selected"<# } #> value="<?php echo esc_attr('all'); ?>"><?php echo esc_html('all'); ?></option>
23
  <option <# if ( _.contains(data.display.target['ids'],'home') ) { #>selected="selected"<# } #> value="<?php echo esc_attr('home'); ?>"><?php echo esc_html('home'); ?></option>
24
- <option <# if (_.contains(data.display.target['ids'], 'blog') ) { #>selected="selected"<# } #> value="<?php echo esc_attr('blog'); ?>"><?php echo esc_html('blog'); ?></option>
25
  <option <# if ( _.contains(data.display.target['ids'],'search')) { #>selected="selected"<# } #> value="<?php echo esc_attr('search'); ?>"><?php echo esc_html('search'); ?></option>
26
  <option <# if ( _.contains(data.display.target['ids'],'error') ) { #>selected="selected"<# } #> value="<?php echo esc_attr('error'); ?>"><?php echo esc_html('error'); ?></option>
27
  </select>
21
  <select multiple="multiple" name="display[target][ids][]" data-placeholder="<?php echo esc_attr('Choose target&hellip;', 'wp-whatsapp-chat'); ?>" aria-label="<?php echo esc_attr('Posts', 'wp-whatsapp-chat'); ?>" class="qlwapp-select2">
22
  <option <# if ( _.contains(data.display.target['ids'],'all') ) { #>selected="selected"<# } #> value="<?php echo esc_attr('all'); ?>"><?php echo esc_html('all'); ?></option>
23
  <option <# if ( _.contains(data.display.target['ids'],'home') ) { #>selected="selected"<# } #> value="<?php echo esc_attr('home'); ?>"><?php echo esc_html('home'); ?></option>
24
+ <option <# if ( _.contains(data.display.target['ids'], 'blog') ) { #>selected="selected"<# } #> value="<?php echo esc_attr('blog'); ?>"><?php echo esc_html('blog'); ?></option>
25
  <option <# if ( _.contains(data.display.target['ids'],'search')) { #>selected="selected"<# } #> value="<?php echo esc_attr('search'); ?>"><?php echo esc_html('search'); ?></option>
26
  <option <# if ( _.contains(data.display.target['ids'],'error') ) { #>selected="selected"<# } #> value="<?php echo esc_attr('error'); ?>"><?php echo esc_html('error'); ?></option>
27
  </select>
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://quadlayers.com/portfolio/wordpress-whatsapp-chat/
4
  Tags: whatsapp, whatsapp chat, whatsapp business, whatsapp support, click to chat, whatsapp group, directly message whatsapp, floating whatsapp, whatsapp message, help desk
5
  Requires at least: 3.0
6
  Tested up to: 5.3.2
7
- Stable tag: 4.6.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
4
  Tags: whatsapp, whatsapp chat, whatsapp business, whatsapp support, click to chat, whatsapp group, directly message whatsapp, floating whatsapp, whatsapp message, help desk
5
  Requires at least: 3.0
6
  Tested up to: 5.3.2
7
+ Stable tag: 4.6.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
wp-whatsapp-chat.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: WhatsApp Chat
5
  * Plugin URI: https://quadlayers.com/portfolio/wordpress-whatsapp-chat/
6
  * Description: WhatsApp Chat allows your visitors to contact you or your team through WhatsApp chat with a single click.
7
- * Version: 4.6.0
8
  * Author: QuadLayers
9
  * Author URI: https://quadlayers.com
10
  * License: GPL-2.0+
@@ -17,7 +17,7 @@ if (!defined('ABSPATH')) {
17
  }
18
 
19
  define('QLWAPP_PLUGIN_NAME', 'WhatsApp Chat');
20
- define('QLWAPP_PLUGIN_VERSION', '4.6.0');
21
  define('QLWAPP_PLUGIN_FILE', __FILE__);
22
  define('QLWAPP_PLUGIN_DIR', __DIR__ . DIRECTORY_SEPARATOR);
23
  define('QLWAPP_PREFIX', 'qlwapp');
4
  * Plugin Name: WhatsApp Chat
5
  * Plugin URI: https://quadlayers.com/portfolio/wordpress-whatsapp-chat/
6
  * Description: WhatsApp Chat allows your visitors to contact you or your team through WhatsApp chat with a single click.
7
+ * Version: 4.6.1
8
  * Author: QuadLayers
9
  * Author URI: https://quadlayers.com
10
  * License: GPL-2.0+
17
  }
18
 
19
  define('QLWAPP_PLUGIN_NAME', 'WhatsApp Chat');
20
+ define('QLWAPP_PLUGIN_VERSION', '4.6.1');
21
  define('QLWAPP_PLUGIN_FILE', __FILE__);
22
  define('QLWAPP_PLUGIN_DIR', __DIR__ . DIRECTORY_SEPARATOR);
23
  define('QLWAPP_PREFIX', 'qlwapp');