Ivory Search – WordPress Search Plugin - Version 4.7.1

Version Description

  • Improved - Code quality to adhere to WordPress development standards and improve safety/security.
Download this release

Release Info

Developer vinod dalvi
Plugin Icon 128x128 Ivory Search – WordPress Search Plugin
Version 4.7.1
Comparing to
See all releases

Code changes from version 4.7 to 4.7.1

add-search-to-menu.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Ivory Search
4
  * Plugin URI: https://ivorysearch.com
5
  * Description: The WordPress Search plugin that includes Search Form Customizer, WooCommerce Search, Image Search, Search Shortcode, AJAX Search & Live Search support!
6
- * Version: 4.7
7
  * Author: Ivory Search
8
  * Author URI: https://ivorysearch.com/
9
  * License: GPL2+
@@ -12,7 +12,7 @@
12
  * Text Domain: add-search-to-menu
13
  *
14
  *
15
- * WC tested up to: 5.7
16
  *
17
  * Ivory Search is free software: you can redistribute it and/or modify
18
  * it under the terms of the GNU General Public License as published by
@@ -108,7 +108,7 @@ final class Ivory_Search {
108
  private function define_constants() {
109
 
110
  if ( ! defined( 'IS_VERSION' ) ) {
111
- define( 'IS_VERSION', '4.7' );
112
  }
113
  if ( ! defined( 'IS_PLUGIN_FILE' ) ) {
114
  define( 'IS_PLUGIN_FILE', __FILE__ );
@@ -136,20 +136,41 @@ final class Ivory_Search {
136
  */
137
  public function includes() {
138
 
139
- foreach( glob( IS_PLUGIN_DIR.'includes/' . "*.php" ) as $file ) {
140
- require_once $file;
141
- }
 
 
 
 
 
 
 
 
 
 
 
142
 
143
  if ( is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
144
- foreach( glob( IS_PLUGIN_DIR.'admin/' . "*.php" ) as $file ) {
145
- require_once $file;
146
- }
 
 
 
 
 
 
 
147
  }
148
 
149
  if ( ! is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
150
- foreach( glob( IS_PLUGIN_DIR.'public/' . "*.php" ) as $file ) {
151
- require_once $file;
152
- }
 
 
 
153
  }
154
  }
155
 
@@ -182,4 +203,4 @@ function ivory_search_start(){
182
  $is = Ivory_Search::getInstance();
183
  $is->start();
184
  }
185
- add_action( 'plugins_loaded', 'ivory_search_start' );
3
  * Plugin Name: Ivory Search
4
  * Plugin URI: https://ivorysearch.com
5
  * Description: The WordPress Search plugin that includes Search Form Customizer, WooCommerce Search, Image Search, Search Shortcode, AJAX Search & Live Search support!
6
+ * Version: 4.7.1
7
  * Author: Ivory Search
8
  * Author URI: https://ivorysearch.com/
9
  * License: GPL2+
12
  * Text Domain: add-search-to-menu
13
  *
14
  *
15
+ * WC tested up to: 5.8
16
  *
17
  * Ivory Search is free software: you can redistribute it and/or modify
18
  * it under the terms of the GNU General Public License as published by
108
  private function define_constants() {
109
 
110
  if ( ! defined( 'IS_VERSION' ) ) {
111
+ define( 'IS_VERSION', '4.7.1' );
112
  }
113
  if ( ! defined( 'IS_PLUGIN_FILE' ) ) {
114
  define( 'IS_PLUGIN_FILE', __FILE__ );
136
  */
137
  public function includes() {
138
 
139
+ /**
140
+ * Common Files
141
+ */
142
+ require_once IS_PLUGIN_DIR . 'includes/base-functions.php';
143
+ require_once IS_PLUGIN_DIR . 'includes/class-is-activator.php';
144
+ require_once IS_PLUGIN_DIR . 'includes/class-is-admin-public.php';
145
+ require_once IS_PLUGIN_DIR . 'includes/class-is-customizer-panel.php';
146
+ require_once IS_PLUGIN_DIR . 'includes/class-is-customizer.php';
147
+ require_once IS_PLUGIN_DIR . 'includes/class-is-deactivator.php';
148
+ require_once IS_PLUGIN_DIR . 'includes/class-is-i18n.php';
149
+ require_once IS_PLUGIN_DIR . 'includes/class-is.php';
150
+ require_once IS_PLUGIN_DIR . 'includes/class-is-search-form.php';
151
+ require_once IS_PLUGIN_DIR . 'includes/class-is-widget.php';
152
+ require_once IS_PLUGIN_DIR . 'includes/freemius.php';
153
 
154
  if ( is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
155
+
156
+ /**
157
+ * Admin Files
158
+ */
159
+ require_once IS_PLUGIN_DIR . 'admin/class-is-admin.php';
160
+ require_once IS_PLUGIN_DIR . 'admin/class-is-editor.php';
161
+ require_once IS_PLUGIN_DIR . 'admin/class-is-help.php';
162
+ require_once IS_PLUGIN_DIR . 'admin/class-is-list-table.php';
163
+ require_once IS_PLUGIN_DIR . 'admin/class-is-settings-fields.php';
164
+
165
  }
166
 
167
  if ( ! is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
168
+
169
+ /**
170
+ * Public Files
171
+ */
172
+ require_once IS_PLUGIN_DIR . 'public/class-is-ajax.php';
173
+ require_once IS_PLUGIN_DIR . 'public/class-is-public.php';
174
  }
175
  }
176
 
203
  $is = Ivory_Search::getInstance();
204
  $is->start();
205
  }
206
+ add_action( 'plugins_loaded', 'ivory_search_start' );
admin/class-is-admin.php CHANGED
@@ -113,23 +113,26 @@ class IS_Admin
113
  if ( $array['active'] ) {
114
  ?>
115
  $( '<?php
116
- echo $array['anchor_id'] ;
117
  ?>' ).pointer( {
118
  content: '<?php
119
- echo $array['content'] ;
 
 
 
120
  ?>',
121
  position: {
122
  edge: '<?php
123
- echo $array['edge'] ;
124
  ?>',
125
  align: '<?php
126
- echo $array['align'] ;
127
  ?>'
128
  },
129
  close: function() {
130
  $.post( ajaxurl, {
131
  pointer: '<?php
132
- echo $pointer ;
133
  ?>',
134
  action: 'dismiss-wp-pointer'
135
  } );
@@ -270,7 +273,7 @@ class IS_Admin
270
  function display_posts()
271
  {
272
  $posts = get_posts( array(
273
- 'post_type' => $_REQUEST['post_type'],
274
  'posts_per_page' => -1,
275
  'orderby' => 'title',
276
  'order' => 'ASC',
@@ -278,7 +281,7 @@ class IS_Admin
278
 
279
  if ( !empty($posts) ) {
280
  $temp = '';
281
- $meta = get_post_meta( $_REQUEST['post_id'] );
282
 
283
  if ( 'includes' === $_REQUEST['inc_exc'] && isset( $meta['_is_includes'] ) ) {
284
  $meta = maybe_unserialize( $meta['_is_includes'][0] );
@@ -299,10 +302,10 @@ class IS_Admin
299
  }
300
  }
301
 
302
- $post_title = ( isset( $post2->post_title ) && '' !== $post2->post_title ? esc_html( $post2->post_title ) : $post2->post_name );
303
- $temp .= '<option value="' . esc_attr( $post2->ID ) . '" ' . selected( $post2->ID, $checked, false ) . '>' . $post_title . '</option>';
304
  }
305
- echo $temp ;
306
  } else {
307
  _e( 'No posts found', 'add-search-to-menu' );
308
  }
@@ -440,22 +443,22 @@ class IS_Admin
440
  $excludes = __( "Excludes", 'add-search-to-menu' );
441
 
442
  if ( isset( $_REQUEST['tab'] ) ) {
443
- $url = esc_url( menu_page_url( 'ivory-search', false ) );
444
- if ( isset( $_REQUEST['post'] ) ) {
445
- $url .= '&post=' . esc_html( $_REQUEST['post'] ) . '&action=edit';
446
  }
447
 
448
  if ( 'excludes' == $_REQUEST['tab'] ) {
449
- $includes = '<a href="' . $url . '&tab=includes">' . __( "Includes", 'add-search-to-menu' ) . '</a>';
450
  } else {
451
  if ( 'includes' == $_REQUEST['tab'] ) {
452
- $excludes = '<a href="' . $url . '&tab=excludes">' . __( "Excludes", 'add-search-to-menu' ) . '</a>';
453
  }
454
  }
455
 
456
  }
457
 
458
- $temp_mes = ( isset( $_REQUEST['data'] ) ? esc_html( $_REQUEST['data'] ) : '' );
459
  $updated_message2 = sprintf(
460
  __( "Please make sure you have not selected similar %s fields in the search form %s and %s sections.", 'add-search-to-menu' ),
461
  $temp_mes,
@@ -572,9 +575,12 @@ class IS_Admin
572
  if ( current_user_can( 'is_edit_search_forms' ) ) {
573
  echo sprintf( '<a href="%1$s" class="add-new-h2">%2$s</a>', esc_url( menu_page_url( 'ivory-search-new', false ) ), esc_html( __( 'Add New Search Form', 'add-search-to-menu' ) ) ) ;
574
  }
 
575
  if ( !empty($_REQUEST['s']) ) {
576
- echo sprintf( '<span class="subtitle">' . __( 'Search results for &#8220;%s&#8221;', 'add-search-to-menu' ) . '</span>', esc_html( $_REQUEST['s'] ) ) ;
 
577
  }
 
578
  ?>
579
 
580
  <hr class="wp-header-end" />
@@ -626,25 +632,25 @@ class IS_Admin
626
  function load_admin_search_form()
627
  {
628
  global $plugin_page ;
629
- $action = ( isset( $_REQUEST['action'] ) && -1 != $_REQUEST['action'] ? $_REQUEST['action'] : false );
630
 
631
  if ( 'save' == $action ) {
632
- $id = ( isset( $_POST['post_ID'] ) ? $_POST['post_ID'] : '-1' );
633
  check_admin_referer( 'is-save-search-form_' . $id );
634
  if ( !current_user_can( 'is_edit_search_form', $id ) ) {
635
  wp_die( __( 'You are not allowed to edit this item.', 'add-search-to-menu' ) );
636
  }
637
- $args = $_REQUEST;
638
  $args['id'] = $id;
639
- $args['title'] = ( isset( $_POST['post_title'] ) ? $_POST['post_title'] : null );
640
  $args['title'] = ( null != $args['title'] && 'default search form' == strtolower( $args['title'] ) ? $args['title'] . ' ( Duplicate )' : $args['title'] );
641
- $args['_is_locale'] = ( isset( $_POST['is_locale'] ) ? $_POST['is_locale'] : null );
642
- $args['_is_includes'] = ( isset( $_POST['_is_includes'] ) ? $_POST['_is_includes'] : '' );
643
- $args['_is_excludes'] = ( isset( $_POST['_is_excludes'] ) ? $_POST['_is_excludes'] : '' );
644
- $args['_is_ajax'] = ( isset( $_POST['_is_ajax'] ) ? $_POST['_is_ajax'] : '' );
645
- $args['_is_customize'] = ( isset( $_POST['_is_customize'] ) ? $_POST['_is_customize'] : '' );
646
- $args['_is_settings'] = ( isset( $_POST['_is_settings'] ) ? $_POST['_is_settings'] : '' );
647
- $args['tab'] = ( isset( $_POST['tab'] ) ? $_POST['tab'] : 'includes' );
648
  $properties = array();
649
 
650
  if ( '-1' != $id ) {
@@ -698,7 +704,7 @@ class IS_Admin
698
  if ( $invalid ) {
699
  $query = array(
700
  'post' => $id,
701
- 'tab' => ( isset( $_POST['tab'] ) ? $_POST['tab'] : 'includes' ),
702
  );
703
  $query['message'] = 'invalid';
704
  $query['data'] = $invalid;
@@ -706,7 +712,7 @@ class IS_Admin
706
  $search_form = $this->save_form( $args );
707
  $query = array(
708
  'post' => ( $search_form ? $search_form->id() : 0 ),
709
- 'tab' => ( isset( $_POST['tab'] ) ? $_POST['tab'] : 'includes' ),
710
  );
711
 
712
  if ( !$search_form ) {
@@ -735,7 +741,7 @@ class IS_Admin
735
 
736
  if ( $id ) {
737
  $args['id'] = $id;
738
- $args['title'] = ( isset( $_POST['post_title'] ) ? $_POST['post_title'] : null );
739
  $args['_is_locale'] = null;
740
  $args['_is_includes'] = '';
741
  $args['_is_excludes'] = '';
@@ -744,7 +750,7 @@ class IS_Admin
744
  $args['_is_settings'] = '';
745
  $search_form = $this->save_form( $args );
746
  $query['post'] = $id;
747
- $query['tab'] = ( isset( $_POST['tab'] ) ? $_POST['tab'] : 'includes' );
748
  $query['message'] = 'reset';
749
  }
750
 
@@ -777,19 +783,19 @@ class IS_Admin
777
 
778
  if ( 'delete' == $action ) {
779
 
780
- if ( !empty($_POST['post_ID']) ) {
781
- check_admin_referer( 'is-delete-search-form_' . $_POST['post_ID'] );
782
  } else {
783
 
784
  if ( !is_array( $_REQUEST['post'] ) ) {
785
- check_admin_referer( 'is-delete-search-form_' . $_REQUEST['post'] );
786
  } else {
787
  check_admin_referer( 'bulk-posts' );
788
  }
789
 
790
  }
791
 
792
- $posts = ( empty($_POST['post_ID']) ? (array) $_REQUEST['post'] : (array) $_POST['post_ID'] );
793
  $deleted = 0;
794
  foreach ( $posts as $post ) {
795
  $post = IS_Search_Form::get_instance( $post );
@@ -813,15 +819,17 @@ class IS_Admin
813
  exit;
814
  }
815
 
816
- $_GET['post'] = ( isset( $_GET['post'] ) ? $_GET['post'] : '' );
 
 
817
  $post = null;
818
 
819
  if ( 'ivory-search-new' == $plugin_page ) {
820
  $post = IS_Search_Form::get_template( array(
821
- 'locale' => ( isset( $_GET['locale'] ) ? $_GET['locale'] : null ),
822
  ) );
823
- } elseif ( !empty($_GET['post']) ) {
824
- $post = IS_Search_Form::get_instance( $_GET['post'] );
825
  }
826
 
827
  $current_screen = get_current_screen();
@@ -898,11 +906,11 @@ class IS_Admin
898
  );
899
  }
900
 
901
- $properties['_is_includes'] = $this->sanitize_includes( $args['_is_includes'] );
902
  }
903
 
904
  if ( null === $args['tab'] || 'excludes' === $args['tab'] ) {
905
- $properties['_is_excludes'] = $this->sanitize_excludes( $args['_is_excludes'] );
906
  }
907
 
908
  if ( null === $args['tab'] || 'options' === $args['tab'] ) {
@@ -912,14 +920,14 @@ class IS_Admin
912
  'order' => 'DESC',
913
  );
914
  }
915
- $properties['_is_settings'] = $this->sanitize_settings( $args['_is_settings'] );
916
  }
917
 
918
  if ( null === $args['tab'] || 'ajax' === $args['tab'] ) {
919
- $properties['_is_ajax'] = $this->sanitize_settings( $args['_is_ajax'] );
920
  }
921
  if ( null === $args['tab'] || 'customize' === $args['tab'] ) {
922
- $properties['_is_customize'] = $this->sanitize_settings( $args['_is_customize'] );
923
  }
924
  $search_form->set_properties( $properties );
925
  do_action(
@@ -996,15 +1004,15 @@ class IS_Admin
996
 
997
  if ( is_array( $value2 ) ) {
998
  foreach ( $value2 as $key3 => $value3 ) {
999
- $output[$key][$key2][$key3] = esc_attr( $input[$key][$key2][$key3] );
1000
  }
1001
  } else {
1002
- $output[$key][$key2] = esc_attr( $input[$key][$key2] );
1003
  }
1004
 
1005
  }
1006
  } else {
1007
- $output[$key] = esc_attr( $input[$key] );
1008
  }
1009
 
1010
  }
@@ -1020,14 +1028,18 @@ class IS_Admin
1020
  static $button = '' ;
1021
 
1022
  if ( !empty($button) ) {
1023
- echo $button ;
1024
  return;
1025
  }
1026
 
1027
- $nonce = wp_create_nonce( 'is-save-search-form_' . $post_id );
1028
- $onclick = sprintf( "this.form._wpnonce.value = '%s';" . " this.form.action.value = 'save';" . " return true;", $nonce );
1029
- $button = sprintf( '<input type="submit" class="button-primary" name="is_save" value="%1$s" onclick="%2$s" />', esc_attr( __( 'Save Form', 'add-search-to-menu' ) ), $onclick );
1030
- echo $button ;
 
 
 
 
1031
  }
1032
 
1033
  /**
@@ -1036,13 +1048,13 @@ class IS_Admin
1036
  public static function pro_link( $plan = 'pro' )
1037
  {
1038
  $is_premium_plugin = false;
1039
- $msg = esc_html__( "Upgrade to Pro to Access", 'add-search-to-menu' );
1040
 
1041
  if ( is_fs()->is_plan_or_trial( $plan ) ) {
1042
- $msg = esc_html__( "Install Premium Version to Access", 'add-search-to-menu' );
1043
  } else {
1044
  if ( 'pro_plus' === $plan ) {
1045
- $msg = esc_html__( "Upgrade to Pro Plus to Access", 'add-search-to-menu' );
1046
  }
1047
  }
1048
 
@@ -1050,7 +1062,7 @@ class IS_Admin
1050
  if ( is_fs()->is_plan_or_trial( $plan ) && $is_premium_plugin ) {
1051
  return '';
1052
  } else {
1053
- return '<span class="upgrade-wrapper"><a class="upgrade-link" href="' . esc_url( menu_page_url( 'ivory-search-pricing', false ) ) . '"> ' . $msg . '</a></span>';
1054
  }
1055
 
1056
  }
113
  if ( $array['active'] ) {
114
  ?>
115
  $( '<?php
116
+ esc_html_e( $array['anchor_id'] );
117
  ?>' ).pointer( {
118
  content: '<?php
119
+ echo wp_kses( $array['content'], array(
120
+ 'h3' => array(),
121
+ 'p' => array(),
122
+ ) ) ;
123
  ?>',
124
  position: {
125
  edge: '<?php
126
+ esc_html_e( $array['edge'] );
127
  ?>',
128
  align: '<?php
129
+ esc_html_e( $array['align'] );
130
  ?>'
131
  },
132
  close: function() {
133
  $.post( ajaxurl, {
134
  pointer: '<?php
135
+ esc_html_e( $pointer );
136
  ?>',
137
  action: 'dismiss-wp-pointer'
138
  } );
273
  function display_posts()
274
  {
275
  $posts = get_posts( array(
276
+ 'post_type' => sanitize_text_field( $_REQUEST['post_type'] ),
277
  'posts_per_page' => -1,
278
  'orderby' => 'title',
279
  'order' => 'ASC',
281
 
282
  if ( !empty($posts) ) {
283
  $temp = '';
284
+ $meta = ( isset( $_REQUEST['post_id'] ) && is_numeric( $_REQUEST['post_id'] ) ? get_post_meta( sanitize_key( $_REQUEST['post_id'] ) ) : '' );
285
 
286
  if ( 'includes' === $_REQUEST['inc_exc'] && isset( $meta['_is_includes'] ) ) {
287
  $meta = maybe_unserialize( $meta['_is_includes'][0] );
302
  }
303
  }
304
 
305
+ $post_title = ( isset( $post2->post_title ) && '' !== $post2->post_title ? $post2->post_title : $post2->post_name );
306
+ $temp .= '<option value="' . esc_attr( $post2->ID ) . '" ' . selected( $post2->ID, $checked, false ) . '>' . esc_html( $post_title ) . '</option>';
307
  }
308
+ esc_html_e( $temp );
309
  } else {
310
  _e( 'No posts found', 'add-search-to-menu' );
311
  }
443
  $excludes = __( "Excludes", 'add-search-to-menu' );
444
 
445
  if ( isset( $_REQUEST['tab'] ) ) {
446
+ $url = menu_page_url( 'ivory-search', false );
447
+ if ( isset( $_REQUEST['post'] ) && is_numeric( $_REQUEST['post'] ) ) {
448
+ $url .= '&post=' . esc_url_raw( $_REQUEST['post'] ) . '&action=edit';
449
  }
450
 
451
  if ( 'excludes' == $_REQUEST['tab'] ) {
452
+ $includes = '<a href="' . esc_url( $url ) . '&tab=includes">' . __( "Includes", 'add-search-to-menu' ) . '</a>';
453
  } else {
454
  if ( 'includes' == $_REQUEST['tab'] ) {
455
+ $excludes = '<a href="' . esc_url( $url ) . '&tab=excludes">' . __( "Excludes", 'add-search-to-menu' ) . '</a>';
456
  }
457
  }
458
 
459
  }
460
 
461
+ $temp_mes = ( isset( $_REQUEST['data'] ) ? sanitize_text_field( $_REQUEST['data'] ) : '' );
462
  $updated_message2 = sprintf(
463
  __( "Please make sure you have not selected similar %s fields in the search form %s and %s sections.", 'add-search-to-menu' ),
464
  $temp_mes,
575
  if ( current_user_can( 'is_edit_search_forms' ) ) {
576
  echo sprintf( '<a href="%1$s" class="add-new-h2">%2$s</a>', esc_url( menu_page_url( 'ivory-search-new', false ) ), esc_html( __( 'Add New Search Form', 'add-search-to-menu' ) ) ) ;
577
  }
578
+
579
  if ( !empty($_REQUEST['s']) ) {
580
+ $is_search_input = sanitize_text_field( $_REQUEST['s'] );
581
+ echo sprintf( '<span class="subtitle">' . __( 'Search results for &#8220;%s&#8221;', 'add-search-to-menu' ) . '</span>', esc_html( $is_search_input ) ) ;
582
  }
583
+
584
  ?>
585
 
586
  <hr class="wp-header-end" />
632
  function load_admin_search_form()
633
  {
634
  global $plugin_page ;
635
+ $action = ( isset( $_REQUEST['action'] ) && -1 != $_REQUEST['action'] ? sanitize_text_field( $_REQUEST['action'] ) : false );
636
 
637
  if ( 'save' == $action ) {
638
+ $id = ( isset( $_POST['post_ID'] ) && is_numeric( $_POST['post_ID'] ) ? sanitize_key( $_POST['post_ID'] ) : '-1' );
639
  check_admin_referer( 'is-save-search-form_' . $id );
640
  if ( !current_user_can( 'is_edit_search_form', $id ) ) {
641
  wp_die( __( 'You are not allowed to edit this item.', 'add-search-to-menu' ) );
642
  }
643
+ $args = $this->sanitize_settings( $_REQUEST );
644
  $args['id'] = $id;
645
+ $args['title'] = ( isset( $_POST['post_title'] ) ? sanitize_text_field( $_POST['post_title'] ) : null );
646
  $args['title'] = ( null != $args['title'] && 'default search form' == strtolower( $args['title'] ) ? $args['title'] . ' ( Duplicate )' : $args['title'] );
647
+ $args['_is_locale'] = ( isset( $_POST['is_locale'] ) ? sanitize_text_field( $_POST['is_locale'] ) : null );
648
+ $args['_is_includes'] = ( isset( $_POST['_is_includes'] ) && is_array( $_POST['_is_includes'] ) ? $this->sanitize_includes( $_POST['_is_includes'] ) : '' );
649
+ $args['_is_excludes'] = ( isset( $_POST['_is_excludes'] ) && is_array( $_POST['_is_excludes'] ) ? $this->sanitize_excludes( $_POST['_is_excludes'] ) : '' );
650
+ $args['_is_ajax'] = ( isset( $_POST['_is_ajax'] ) && is_array( $_POST['_is_ajax'] ) ? $this->sanitize_settings( $_POST['_is_ajax'] ) : '' );
651
+ $args['_is_customize'] = ( isset( $_POST['_is_customize'] ) && is_array( $_POST['_is_customize'] ) ? $this->sanitize_settings( $_POST['_is_customize'] ) : '' );
652
+ $args['_is_settings'] = ( isset( $_POST['_is_settings'] ) && is_array( $_POST['_is_settings'] ) ? $this->sanitize_settings( $_POST['_is_settings'] ) : '' );
653
+ $args['tab'] = ( isset( $_POST['tab'] ) ? sanitize_text_field( $_POST['tab'] ) : 'includes' );
654
  $properties = array();
655
 
656
  if ( '-1' != $id ) {
704
  if ( $invalid ) {
705
  $query = array(
706
  'post' => $id,
707
+ 'tab' => ( isset( $_POST['tab'] ) ? sanitize_text_field( $_POST['tab'] ) : 'includes' ),
708
  );
709
  $query['message'] = 'invalid';
710
  $query['data'] = $invalid;
712
  $search_form = $this->save_form( $args );
713
  $query = array(
714
  'post' => ( $search_form ? $search_form->id() : 0 ),
715
+ 'tab' => ( isset( $_POST['tab'] ) ? sanitize_text_field( $_POST['tab'] ) : 'includes' ),
716
  );
717
 
718
  if ( !$search_form ) {
741
 
742
  if ( $id ) {
743
  $args['id'] = $id;
744
+ $args['title'] = ( isset( $_POST['post_title'] ) ? sanitize_text_field( $_POST['post_title'] ) : null );
745
  $args['_is_locale'] = null;
746
  $args['_is_includes'] = '';
747
  $args['_is_excludes'] = '';
750
  $args['_is_settings'] = '';
751
  $search_form = $this->save_form( $args );
752
  $query['post'] = $id;
753
+ $query['tab'] = ( isset( $_POST['tab'] ) ? sanitize_text_field( $_POST['tab'] ) : 'includes' );
754
  $query['message'] = 'reset';
755
  }
756
 
783
 
784
  if ( 'delete' == $action ) {
785
 
786
+ if ( !empty($_POST['post_ID']) && is_numeric( $_POST['post_ID'] ) ) {
787
+ check_admin_referer( 'is-delete-search-form_' . sanitize_key( $_POST['post_ID'] ) );
788
  } else {
789
 
790
  if ( !is_array( $_REQUEST['post'] ) ) {
791
+ check_admin_referer( 'is-delete-search-form_' . sanitize_key( $_REQUEST['post'] ) );
792
  } else {
793
  check_admin_referer( 'bulk-posts' );
794
  }
795
 
796
  }
797
 
798
+ $posts = ( empty($_POST['post_ID']) ? array_map( 'sanitize_key', (array) $_REQUEST['post'] ) : array_map( 'sanitize_key', (array) $_REQUEST['post_ID'] ) );
799
  $deleted = 0;
800
  foreach ( $posts as $post ) {
801
  $post = IS_Search_Form::get_instance( $post );
819
  exit;
820
  }
821
 
822
+ if ( !isset( $_GET['post'] ) ) {
823
+ $_GET['post'] = '';
824
+ }
825
  $post = null;
826
 
827
  if ( 'ivory-search-new' == $plugin_page ) {
828
  $post = IS_Search_Form::get_template( array(
829
+ 'locale' => ( isset( $_GET['locale'] ) ? sanitize_text_field( $_GET['locale'] ) : null ),
830
  ) );
831
+ } elseif ( !empty($_GET['post']) && is_numeric( $_GET['post'] ) ) {
832
+ $post = IS_Search_Form::get_instance( sanitize_key( $_GET['post'] ) );
833
  }
834
 
835
  $current_screen = get_current_screen();
906
  );
907
  }
908
 
909
+ $properties['_is_includes'] = $args['_is_includes'];
910
  }
911
 
912
  if ( null === $args['tab'] || 'excludes' === $args['tab'] ) {
913
+ $properties['_is_excludes'] = $args['_is_excludes'];
914
  }
915
 
916
  if ( null === $args['tab'] || 'options' === $args['tab'] ) {
920
  'order' => 'DESC',
921
  );
922
  }
923
+ $properties['_is_settings'] = $args['_is_settings'];
924
  }
925
 
926
  if ( null === $args['tab'] || 'ajax' === $args['tab'] ) {
927
+ $properties['_is_ajax'] = $args['_is_ajax'];
928
  }
929
  if ( null === $args['tab'] || 'customize' === $args['tab'] ) {
930
+ $properties['_is_customize'] = $args['_is_customize'];
931
  }
932
  $search_form->set_properties( $properties );
933
  do_action(
1004
 
1005
  if ( is_array( $value2 ) ) {
1006
  foreach ( $value2 as $key3 => $value3 ) {
1007
+ $output[$key][$key2][$key3] = sanitize_textarea_field( $input[$key][$key2][$key3] );
1008
  }
1009
  } else {
1010
+ $output[$key][$key2] = sanitize_textarea_field( $input[$key][$key2] );
1011
  }
1012
 
1013
  }
1014
  } else {
1015
+ $output[$key] = sanitize_textarea_field( $input[$key] );
1016
  }
1017
 
1018
  }
1028
  static $button = '' ;
1029
 
1030
  if ( !empty($button) ) {
1031
+ esc_html_e( $button );
1032
  return;
1033
  }
1034
 
1035
+ $onclick = "this.form._wpnonce.value = '" . wp_create_nonce( 'is-save-search-form_' . $post_id ) . "'; this.form.action.value = 'save'; return true;";
1036
+ ?>
1037
+ <input type="submit" class="button-primary" name="is_save" value="<?php
1038
+ esc_attr_e( 'Save Form', 'add-search-to-menu' );
1039
+ ?>" onclick="<?php
1040
+ echo esc_js( $onclick ) ;
1041
+ ?>" />
1042
+ <?php
1043
  }
1044
 
1045
  /**
1048
  public static function pro_link( $plan = 'pro' )
1049
  {
1050
  $is_premium_plugin = false;
1051
+ $msg = __( "Upgrade to Pro to Access", 'add-search-to-menu' );
1052
 
1053
  if ( is_fs()->is_plan_or_trial( $plan ) ) {
1054
+ $msg = __( "Install Premium Version to Access", 'add-search-to-menu' );
1055
  } else {
1056
  if ( 'pro_plus' === $plan ) {
1057
+ $msg = __( "Upgrade to Pro Plus to Access", 'add-search-to-menu' );
1058
  }
1059
  }
1060
 
1062
  if ( is_fs()->is_plan_or_trial( $plan ) && $is_premium_plugin ) {
1063
  return '';
1064
  } else {
1065
+ return '<span class="upgrade-wrapper"><a class="upgrade-link" href="' . esc_url( menu_page_url( 'ivory-search-pricing', false ) ) . '"> ' . esc_html( $msg ) . '</a></span>';
1066
  }
1067
 
1068
  }
admin/class-is-editor.php CHANGED
@@ -37,9 +37,9 @@ class IS_Search_Editor
37
  return;
38
  }
39
  echo '<ul id="search-form-editor-tabs">' ;
40
- $url = esc_url( menu_page_url( 'ivory-search-new', false ) );
41
  if ( isset( $_GET['post'] ) && is_numeric( $_GET['post'] ) ) {
42
- $url = esc_url( menu_page_url( 'ivory-search', false ) ) . '&post=' . $_GET['post'] . '&action=edit';
43
  }
44
  $tab = 'includes';
45
  if ( isset( $_GET['tab'] ) ) {
@@ -64,7 +64,7 @@ class IS_Search_Editor
64
  '<li id="%1$s-tab" class="%2$s"><a href="%3$s" title="%4$s">%5$s</a></li>',
65
  esc_attr( $id ),
66
  esc_attr( $class ),
67
- $url . '&tab=' . $id,
68
  esc_attr( $panel['description'] ),
69
  esc_html( $panel['title'] )
70
  ) ;
@@ -121,10 +121,10 @@ class IS_Search_Editor
121
  }
122
 
123
  if ( isset( $_REQUEST['post'] ) ) {
124
- $includes_url = '<a href="' . esc_url( menu_page_url( 'ivory-search', false ) ) . '&post=' . $_REQUEST['post'] . '&action=edit&tab=' . $section . '">' . $sec_name . '</a>';
125
  } else {
126
  if ( isset( $_REQUEST['page'] ) && 'ivory-search-new' === $_REQUEST['page'] ) {
127
- $includes_url = '<a href="' . esc_url( menu_page_url( 'ivory-search-new', false ) ) . '&tab=' . $section . '">' . $sec_name . '</a>';
128
  }
129
  }
130
 
@@ -145,14 +145,14 @@ class IS_Search_Editor
145
  ?>
146
  </h4>
147
  <div class="search-form-editor-box" id="<?php
148
- echo $id ;
149
  ?>">
150
 
151
  <div class="form-table form-table-panel-includes">
152
 
153
  <h3 scope="row">
154
  <label for="<?php
155
- echo $id ;
156
  ?>-post_type"><?php
157
  esc_html_e( 'Post Types', 'add-search-to-menu' );
158
  ?></label>
@@ -194,7 +194,7 @@ class IS_Search_Editor
194
  echo '<span style="display:none;" class="is-cb-select">' . __( 'Select Post Types', 'add-search-to-menu' ) . '</span><span class="is-cb-titles">' ;
195
  foreach ( $post_types2 as $post_type2 ) {
196
  if ( isset( $post_types[$post_type2] ) ) {
197
- echo '<span title="' . $post_type2 . '"> ' . $post_types[$post_type2]->labels->name . '</span>' ;
198
  }
199
  }
200
  echo '</span>' ;
@@ -204,8 +204,8 @@ class IS_Search_Editor
204
  echo '<div class="is-cb-multisel">' ;
205
  foreach ( $post_types as $key => $post_type ) {
206
  $checked = ( $default_search && in_array( $key, $post_types2 ) || isset( $includes['post_type'][esc_attr( $key )] ) ? esc_attr( $key ) : 0 );
207
- echo '<label for="' . $id . '-post_type-' . esc_attr( $key ) . '"> ' ;
208
- echo '<input class="_is_includes-post_type" type="checkbox" id="' . $id . '-post_type-' . esc_attr( $key ) . '" name="' . $id . '[post_type][' . esc_attr( $key ) . ']" value="' . esc_attr( $key ) . '" ' . checked( $key, $checked, false ) . '/>' ;
209
  echo '<span class="toggle-check-text"></span>' ;
210
  echo ucfirst( esc_html( $post_type->labels->name ) ) . '</label>' ;
211
  }
@@ -217,7 +217,7 @@ class IS_Search_Editor
217
 
218
  if ( isset( $includes['post_type'] ) && is_array( $includes['post_type'] ) && 1 == count( $includes['post_type'] ) ) {
219
  $checked = ( isset( $includes['post_type_url'] ) ? 'y' : 'n' );
220
- echo '<br /><p class="check-radio"><label for="' . $id . '-post_type_url"><input class="_is_includes-post_type_url" type="checkbox" id="' . $id . '-post_type_url" name="' . $id . '[post_type_url]" value="y" ' . checked( 'y', $checked, false ) . '/>' ;
221
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Do not display post_type in the search URL", 'add-search-to-menu' ) . '</label></p>' ;
222
  }
223
 
@@ -242,16 +242,18 @@ class IS_Search_Editor
242
  ?>
243
 
244
  <h3 scope="row" class="is-p-type post-type-<?php
245
- echo $post_type ;
246
  ?>">
247
  <label for="<?php
248
- echo $id ;
249
  ?>-post__in"><?php
250
- echo $accord_title ;
 
 
251
  ?></label>
252
  </h3>
253
  <div class="post-type-<?php
254
- echo $post_type ;
255
  ?>">
256
  <?php
257
  echo '<div>' ;
@@ -276,7 +278,7 @@ class IS_Search_Editor
276
  if ( !empty($posts) ) {
277
  $posts_found = true;
278
  $html .= '<div class="col-wrapper"><div class="col-title">';
279
- $col_title = '<span>' . $post_types[$post_type]->labels->name . '</span>';
280
  $temp = '';
281
  foreach ( $posts as $post2 ) {
282
  $checked = ( isset( $includes['post__in'] ) && in_array( $post2->ID, $includes['post__in'] ) ? $post2->ID : 0 );
@@ -290,10 +292,10 @@ class IS_Search_Editor
290
  $col_title = '<strong>' . $col_title . '</strong>';
291
  }
292
  $html .= $col_title . '<input class="list-search" placeholder="' . __( "Search..", 'add-search-to-menu' ) . '" type="text"></div>';
293
- $html .= '<select class="_is_includes-post__in" name="' . $id . '[post__in][]" multiple size="8" >';
294
  $html .= $temp . '</select>';
295
  if ( count( $posts ) >= 100 && !defined( 'DISABLE_IS_LOAD_ALL' ) && !isset( $includes['post__in'] ) ) {
296
- $html .= '<div id="' . $post_type . '" class="load-all">' . __( 'Load All', 'add-search-to-menu' ) . '</div>';
297
  }
298
  $html .= '</div><br />';
299
  }
@@ -302,7 +304,7 @@ class IS_Search_Editor
302
  if ( !$posts_found ) {
303
  $html .= '<span class="notice-is-info">' . sprintf( __( 'No %s created.', 'add-search-to-menu' ), $post_types[$post_type]->labels->name ) . '</span>';
304
  } else {
305
- $html .= '<label for="' . $id . '-post__in" class="ctrl-multi-select">' . esc_html__( "Hold down the control (ctrl) or command button to select multiple options.", 'add-search-to-menu' ) . '</label><br />';
306
  }
307
 
308
  $html .= '</div>';
@@ -312,19 +314,19 @@ class IS_Search_Editor
312
  $checked = 'selected';
313
  } else {
314
  if ( isset( $includes['post__in'] ) ) {
315
- echo '<span class="notice-is-info">' . sprintf( __( 'The %s are not searchable as the search form is configured to only search specific posts of another post type.', 'add-search-to-menu' ), strtolower( $post_types[$post_type]->labels->name ) ) . '</span><br /><br />' ;
316
  }
317
  }
318
 
319
 
320
  if ( $posts_found ) {
321
- echo '<p class="check-radio"><label for="' . $post_type . '-post-search_all" ><input class="is-post-select" type="radio" id="' . $post_type . '-post-search_all" name="' . $post_type . 'i[post_search_radio]" value="all" ' . checked( 'all', $checked, false ) . '/>' ;
322
- echo '<span class="toggle-check-text"></span>' . sprintf( esc_html__( "Search all %s", 'add-search-to-menu' ), strtolower( $post_types[$post_type]->labels->name ) ) . '</label></p>' ;
323
- echo '<p class="check-radio"><label for="' . $post_type . '-post-search_selected" ><input class="is-post-select" type="radio" id="' . $post_type . '-post-search_selected" name="' . $post_type . 'i[post_search_radio]" value="selected" ' . checked( 'selected', $checked, false ) . '/>' ;
324
- echo '<span class="toggle-check-text"></span>' . sprintf( esc_html__( "Search only selected %s", 'add-search-to-menu' ), strtolower( $post_types[$post_type]->labels->name ) ) . '</label></p>' ;
325
  }
326
 
327
- echo $html ;
328
  $tax_objs = get_object_taxonomies( $post_type, 'objects' );
329
 
330
  if ( !empty($tax_objs) ) {
@@ -347,8 +349,8 @@ class IS_Search_Editor
347
  $selected_tax = true;
348
  }
349
 
350
- $html .= $col_title . '<input class="list-search" placeholder="' . __( "Search..", 'add-search-to-menu' ) . '" type="text"></div><input type="hidden" id="' . $id . '-tax_post_type" name="' . $id . '[tax_post_type][' . $key . ']" value="' . implode( ',', $tax_obj->object_type ) . '" />';
351
- $html .= '<select class="_is_includes-tax_query" name="' . $id . '[tax_query][' . $key . '][]" multiple size="8" >';
352
  foreach ( $terms as $key2 => $term ) {
353
  $checked = ( isset( $includes['tax_query'][$key] ) && in_array( $term->term_taxonomy_id, $includes['tax_query'][$key] ) ? $term->term_taxonomy_id : 0 );
354
  $html .= '<option value="' . esc_attr( $term->term_taxonomy_id ) . '" ' . selected( $term->term_taxonomy_id, $checked, false ) . '>' . esc_html( $term->name ) . '</option>';
@@ -359,20 +361,20 @@ class IS_Search_Editor
359
  }
360
 
361
  if ( $terms_exist ) {
362
- $html .= '<br /><label for="' . $id . '-tax_query" class="ctrl-multi-select">' . esc_html__( "Hold down the control (ctrl) or command button to select multiple options.", 'add-search-to-menu' ) . '</label><br />';
363
  $html .= '</div>';
364
  $checked = ( $selected_tax ? 'selected' : 'all' );
365
- echo '<br /><p class="check-radio"><label for="' . $post_type . '-tax-search_all" ><input class="is-tax-select" type="radio" id="' . $post_type . '-tax-search_all" name="' . $post_type . 'i[tax_search_radio]" value="all" ' . checked( 'all', $checked, false ) . '/>' ;
366
  echo '<span class="toggle-check-text"></span>' . sprintf(
367
  esc_html__( "Search %s of all taxonomies (%s categories, tags & terms %s)", 'add-search-to-menu' ),
368
  strtolower( $post_types[$post_type]->labels->name ),
369
  '<i>',
370
  '</i>'
371
  ) . '</label></p>' ;
372
- echo '<p class="check-radio"><label for="' . $post_type . '-tax-search_selected" ><input class="is-tax-select" type="radio" id="' . $post_type . '-tax-search_selected" name="' . $post_type . 'i[tax_search_radio]" value="selected" ' . checked( 'selected', $checked, false ) . '/>' ;
373
  echo '<span class="toggle-check-text"></span>' . sprintf(
374
  esc_html__( "Search %s of only selected taxonomies (%s categories, tags & terms %s)", 'add-search-to-menu' ),
375
- strtolower( $post_types[$post_type]->labels->name ),
376
  '<i>',
377
  '</i>'
378
  ) . '</label></p>' ;
@@ -387,7 +389,7 @@ class IS_Search_Editor
387
  $html = '<div class="col-wrapper is-metas">';
388
  $selected_meta = false;
389
  $html .= '<input class="list-search wide" placeholder="' . __( "Search..", 'add-search-to-menu' ) . '" type="text">';
390
- $html .= '<select class="_is_includes-custom_field" name="' . $id . '[custom_field][]" multiple size="8" >';
391
  foreach ( $meta_keys as $meta_key ) {
392
  $checked = ( isset( $includes['custom_field'] ) && in_array( $meta_key, $includes['custom_field'] ) ? $meta_key : 0 );
393
  if ( $checked ) {
@@ -396,10 +398,10 @@ class IS_Search_Editor
396
  $html .= '<option value="' . esc_attr( $meta_key ) . '" ' . selected( $meta_key, $checked, false ) . '>' . esc_html( $meta_key ) . '</option>';
397
  }
398
  $html .= '</select>';
399
- $html .= '<br /><label for="' . $id . '-custom_field" class="ctrl-multi-select">' . esc_html__( "Hold down the control (ctrl) or command button to select multiple options.", 'add-search-to-menu' ) . '</label><br />';
400
  $html .= '</div>';
401
  $checked = ( $selected_meta ? 'selected' : 'all' );
402
- echo '<br /><p class="check-radio"><label for="' . $post_type . '-meta-search_selected" ><input class="is-meta-select" type="checkbox" id="' . $post_type . '-meta-search_selected" name="' . $post_type . 'i[meta_search_radio]" value="selected" ' . checked( 'selected', $checked, false ) . '/>' ;
403
  echo '<span class="toggle-check-text"></span>' . sprintf( esc_html__( "Search selected %s custom fields values", 'add-search-to-menu' ), $post_type ) . '</label></p>' ;
404
  echo $html ;
405
  }
@@ -412,10 +414,10 @@ class IS_Search_Editor
412
  if ( '' !== $woo_sku_disable ) {
413
  echo '<div class="upgrade-parent">' ;
414
  }
415
- echo '<p class="check-radio"><label for="' . $id . '-sku" ><input class="_is_includes-woocommerce" type="checkbox" ' . $woo_sku_disable . ' id="' . $id . '-sku" name="' . $id . '[woo][sku]" value="1" ' . checked( 1, $checked, false ) . '/>' ;
416
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Search product SKU", 'add-search-to-menu' ) . '</label></p>' ;
417
  $checked = ( isset( $includes['woo']['variation'] ) && $includes['woo']['variation'] ? 1 : 0 );
418
- echo '<p class="check-radio"><label for="' . $id . '-variation" ><input class="_is_includes-woocommerce" type="checkbox" ' . $woo_sku_disable . ' id="' . $id . '-variation" name="' . $id . '[woo][variation]" value="1" ' . checked( 1, $checked, false ) . '/>' ;
419
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Search product variation", 'add-search-to-menu' ) . '</label>' ;
420
  echo IS_Admin::pro_link( 'pro_plus' ) ;
421
  if ( '' !== $woo_sku_disable ) {
@@ -442,14 +444,14 @@ class IS_Search_Editor
442
  ksort( $file_types );
443
  $html = '<br /><div class="is-mime">';
444
  $html .= '<input class="list-search wide" placeholder="' . __( "Search..", 'add-search-to-menu' ) . '" type="text">';
445
- $html .= '<select class="_is_includes-post_file_type" name="' . $id . '[post_file_type][]" ' . $file_type_disable . ' multiple size="8" >';
446
  foreach ( $file_types as $key => $file_type ) {
447
  $checked = ( isset( $includes['post_file_type'] ) && in_array( $file_type, $includes['post_file_type'] ) ? $file_type : 0 );
448
  $html .= '<option value="' . esc_attr( $file_type ) . '" ' . selected( $file_type, $checked, false ) . '>' . esc_html( $key ) . '</option>';
449
  }
450
  $html .= '</select>';
451
  echo IS_Admin::pro_link( 'pro_plus' ) ;
452
- $html .= '<br /><label for="' . $id . '-post_file_type" class="ctrl-multi-select">' . esc_html__( "Hold down the control (ctrl) or command button to select multiple options.", 'add-search-to-menu' ) . '</label><br />';
453
 
454
  if ( isset( $includes['post_file_type'] ) ) {
455
  $html .= __( 'Selected File Types :', 'add-search-to-menu' );
@@ -466,17 +468,17 @@ class IS_Search_Editor
466
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Search only selected MIME types", 'add-search-to-menu' ) . '</label></p>' ;
467
  echo $html ;
468
  echo '<span class="search-attachments-wrapper">' ;
469
- echo '<p class="check-radio"><label for="' . $id . '-search_images"><input class="search-attachments" type="checkbox" id="' . $id . '-search_images" name="search_images" value="1" checked="checked" />' ;
470
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Search Images", 'add-search-to-menu' ) . '</label></p>' ;
471
- echo '<p class="check-radio"><label for="' . $id . '-search_videos"><input class="search-attachments" type="checkbox" id="' . $id . '-search_videos" name="search_videos" value="1" checked="checked" />' ;
472
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Search Videos", 'add-search-to-menu' ) . '</label></p>' ;
473
- echo '<p class="check-radio"><label for="' . $id . '-search_audios"><input class="search-attachments" type="checkbox" id="' . $id . '-search_audios" name="search_audios" value="1" checked="checked" />' ;
474
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Search Audios", 'add-search-to-menu' ) . '</label></p>' ;
475
- echo '<p class="check-radio"><label for="' . $id . '-search_text"><input class="search-attachments" type="checkbox" id="' . $id . '-search_text" name="search_text" value="1" checked="checked" />' ;
476
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Search Text Files", 'add-search-to-menu' ) . '</label></p>' ;
477
- echo '<p class="check-radio"><label for="' . $id . '-search_pdfs"><input class="search-attachments" type="checkbox" id="' . $id . '-search_pdfs" name="search_pdfs" value="1" checked="checked" />' ;
478
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Search PDF Files", 'add-search-to-menu' ) . '</label></p>' ;
479
- echo '<p class="check-radio"><label for="' . $id . '-search_docs"><input class="search-attachments" type="checkbox" id="' . $id . '-search_docs" name="search_docs" value="1" checked="checked"/>' ;
480
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Search Document Files", 'add-search-to-menu' ) . '</label></p>' ;
481
  echo '</span>' ;
482
  if ( '' !== $file_type_disable ) {
@@ -502,7 +504,7 @@ class IS_Search_Editor
502
 
503
  <h3 scope="row">
504
  <label for="<?php
505
- echo $id ;
506
  ?>-extras"><?php
507
  echo esc_html( __( 'Extras', 'add-search-to-menu' ) ) ;
508
  ?></label>
@@ -515,26 +517,26 @@ class IS_Search_Editor
515
  <div><div class="includes_extras">
516
  <h4 scope="row" class="is-first-title">
517
  <label for="<?php
518
- echo $id ;
519
  ?>-search_content"><?php
520
  echo esc_html( __( 'Search Content', 'add-search-to-menu' ) ) ;
521
  ?></label>
522
  </h4>
523
  <?php
524
  $checked = ( $default_search || isset( $includes['search_title'] ) && $includes['search_title'] ? 1 : 0 );
525
- echo '<p class="check-radio"><label for="' . $id . '-search_title"><input class="_is_includes-post_type" type="checkbox" id="' . $id . '-search_title" name="' . $id . '[search_title]" value="1" ' . checked( 1, $checked, false ) . '/>' ;
526
  echo '<span class="toggle-check-text"></span>' . sprintf( esc_html__( "Search post title %s( File title )%s", 'add-search-to-menu' ), '<i>', '</i>' ) . '</label></p>' ;
527
  $checked = ( $default_search || isset( $includes['search_content'] ) && $includes['search_content'] ? 1 : 0 );
528
- echo '<p class="check-radio"><label for="' . $id . '-search_content"><input class="_is_includes-post_type" type="checkbox" id="' . $id . '-search_content" name="' . $id . '[search_content]" value="1" ' . checked( 1, $checked, false ) . '/>' ;
529
  echo '<span class="toggle-check-text"></span>' . sprintf( esc_html__( "Search post content %s( File description )%s", 'add-search-to-menu' ), '<i>', '</i>' ) . '</label></p>' ;
530
  $checked = ( $default_search || isset( $includes['search_excerpt'] ) && $includes['search_excerpt'] ? 1 : 0 );
531
- echo '<p class="check-radio"><label for="' . $id . '-search_excerpt"><input class="_is_includes-post_type" type="checkbox" id="' . $id . '-search_excerpt" name="' . $id . '[search_excerpt]" value="1" ' . checked( 1, $checked, false ) . '/>' ;
532
  echo '<span class="toggle-check-text"></span>' . sprintf( esc_html__( "Search post excerpt %s( File caption )%s", 'add-search-to-menu' ), '<i>', '</i>' ) . '</label></p>' ;
533
  $checked = ( isset( $includes['search_tax_title'] ) && $includes['search_tax_title'] ? 1 : 0 );
534
- echo '<p class="check-radio"><label for="' . $id . '-search_tax_title" ><input class="_is_includes-tax_query" type="checkbox" id="' . $id . '-search_tax_title" name="' . $id . '[search_tax_title]" value="1" ' . checked( 1, $checked, false ) . '/>' ;
535
  echo '<span class="toggle-check-text"></span>' . sprintf( esc_html__( "Search category/tag title %s( Displays posts of the category/tag )%s", 'add-search-to-menu' ), '<i>', '</i>' ) . '</label></p>' ;
536
  $checked = ( isset( $includes['search_tax_desp'] ) && $includes['search_tax_desp'] ? 1 : 0 );
537
- echo '<p class="check-radio"><label for="' . $id . '-search_tax_desp" ><input class="_is_includes-tax_query" type="checkbox" id="' . $id . '-search_tax_desp" name="' . $id . '[search_tax_desp]" value="1" ' . checked( 1, $checked, false ) . '/>' ;
538
  echo '<span class="toggle-check-text"></span>' . sprintf( esc_html__( "Search category/tag description %s( Displays posts of the category/tag )%s", 'add-search-to-menu' ), '<i>', '</i>' ) . '</label></p>' ;
539
 
540
  if ( isset( $includes['tax_query'] ) ) {
@@ -565,9 +567,9 @@ class IS_Search_Editor
565
  }
566
 
567
  $checked = ( isset( $includes['tax_rel'] ) && "AND" == $includes['tax_rel'] ? "AND" : "OR" );
568
- echo '<label for="' . $id . '-tax_rel_and" ><input class="_is_includes-tax_query" type="radio" id="' . $id . '-tax_rel_and" ' . $tax_rel_disable . ' name="' . $id . '[tax_rel]" value="AND" ' . checked( 'AND', $checked, false ) . '/>' ;
569
  echo '<span class="toggle-check-text"></span>' . esc_html__( "AND - Search posts having all the above selected category terms", 'add-search-to-menu' ) . '</label></p>' ;
570
- echo '<p class="check-radio"><label for="' . $id . '-tax_rel_or" ><input class="_is_includes-tax_query" type="radio" id="' . $id . '-tax_rel_or" ' . $tax_rel_disable . ' name="' . $id . '[tax_rel]" value="OR" ' . checked( 'OR', $checked, false ) . '/>' ;
571
  echo '<span class="toggle-check-text"></span>' . esc_html__( "OR - Search posts having any one of the above selected category terms", 'add-search-to-menu' ) . '</label></p>' ;
572
  }
573
 
@@ -576,7 +578,7 @@ class IS_Search_Editor
576
 
577
  <h4 scope="row">
578
  <label for="<?php
579
- echo $id ;
580
  ?>-post_status"><?php
581
  echo esc_html( __( 'Post Status', 'add-search-to-menu' ) ) ;
582
  ?></label>
@@ -613,7 +615,7 @@ class IS_Search_Editor
613
  foreach ( $post_statuses as $key => $post_status ) {
614
  $checked = ( isset( $includes['post_status'][esc_attr( $key )] ) ? $includes['post_status'][esc_attr( $key )] : 0 );
615
  $temp = ( 'publish' === $post_status || 'inherit' === $post_status ? '' : $post_status_disable );
616
- echo '<label for="' . $id . '-post_status-' . esc_attr( $key ) . '"><input class="_is_includes-post_status" type="checkbox" ' . $temp . ' id="' . $id . '-post_status-' . esc_attr( $key ) . '" name="' . $id . '[post_status][' . esc_attr( $key ) . ']" value="' . esc_attr( $key ) . '" ' . checked( $key, $checked, false ) . '/>' ;
617
  echo '<span class="toggle-check-text"></span> ' . ucwords( str_replace( '-', ' ', esc_html( $post_status ) ) ) . '</label>' ;
618
  }
619
  echo '</div></div>' ;
@@ -623,7 +625,7 @@ class IS_Search_Editor
623
  </div></div>
624
  <h4 scope="row">
625
  <label for="<?php
626
- echo $id ;
627
  ?>-author"><?php
628
  echo esc_html( __( 'Authors', 'add-search-to-menu' ) ) ;
629
  ?></label>
@@ -671,7 +673,7 @@ class IS_Search_Editor
671
  continue;
672
  }
673
  $checked = ( isset( $includes['author'][esc_attr( $author->ID )] ) ? $includes['author'][esc_attr( $author->ID )] : 0 );
674
- echo '<label for="' . $id . '-author-' . esc_attr( $author->ID ) . '"><input class="_is_includes-author" type="checkbox" ' . $author_disable . ' id="' . $id . '-author-' . esc_attr( $author->ID ) . '" name="' . $id . '[author][' . esc_attr( $author->ID ) . ']" value="' . esc_attr( $author->ID ) . '" ' . checked( $author->ID, $checked, false ) . '/>' ;
675
  echo '<span class="toggle-check-text"></span> ' . ucfirst( esc_html( $author->display_name ) ) . '</label>' ;
676
  }
677
  echo '</div></div>' ;
@@ -685,14 +687,14 @@ class IS_Search_Editor
685
  echo '</div>' ;
686
  }
687
  $checked = ( isset( $includes['search_author'] ) && $includes['search_author'] ? 1 : 0 );
688
- echo '<p class="check-radio"><label for="' . $id . '-search_author" ><input class="_is_includes-author" type="checkbox" id="' . $id . '-search_author" name="' . $id . '[search_author]" value="1" ' . checked( 1, $checked, false ) . '/>' ;
689
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Search author Display Name and display the posts created by that author", 'add-search-to-menu' ) . '</label></p>' ;
690
  ?>
691
  </div></div>
692
 
693
  <h4 scope="row">
694
  <label for="<?php
695
- echo $id ;
696
  ?>-comment_count"><?php
697
  echo esc_html( __( 'Comments', 'add-search-to-menu' ) ) ;
698
  ?></label>
@@ -704,7 +706,7 @@ class IS_Search_Editor
704
  if ( '' !== $comment_count_disable ) {
705
  echo '<div class="upgrade-parent">' . IS_Admin::pro_link() ;
706
  }
707
- echo '<label for="' . $id . '-comment_count-compare"> ' . esc_html( __( 'Search posts having number of comments', 'add-search-to-menu' ) ) . '</label><select class="_is_includes-comment_count" name="' . $id . '[comment_count][compare]" ' . $comment_count_disable . ' style="min-width: 50px;">' ;
708
  $checked = ( isset( $includes['comment_count']['compare'] ) ? htmlspecialchars_decode( $includes['comment_count']['compare'] ) : '=' );
709
  $compare = array(
710
  '=',
@@ -715,28 +717,28 @@ class IS_Search_Editor
715
  '<='
716
  );
717
  foreach ( $compare as $d ) {
718
- echo '<option value="' . htmlspecialchars_decode( $d ) . '" ' . selected( $d, $checked, false ) . '>' . esc_html( $d ) . '</option>' ;
719
  }
720
  echo '</select>' ;
721
- echo '<select class="_is_includes-comment_count" name="' . $id . '[comment_count][value]" ' . $comment_count_disable . ' >' ;
722
  $checked = ( isset( $includes['comment_count']['value'] ) ? $includes['comment_count']['value'] : 'na' );
723
  echo '<option value="na" ' . selected( 'na', $checked, false ) . '>' . esc_html( __( 'NA', 'add-search-to-menu' ) ) . '</option>' ;
724
  for ( $d = 0 ; $d <= 999 ; $d++ ) {
725
- echo '<option value="' . $d . '" ' . selected( $d, $checked, false ) . '>' . $d . '</option>' ;
726
  }
727
  echo '</select>' ;
728
  if ( '' !== $comment_count_disable ) {
729
  echo '</div>' ;
730
  }
731
  $checked = ( isset( $includes['search_comment'] ) && $includes['search_comment'] ? 1 : 0 );
732
- echo '<p class="check-radio"><label for="' . $id . '-search_comment" ><input class="_is_includes-comment_count" type="checkbox" id="' . $id . '-search_comment" name="' . $id . '[search_comment]" value="1" ' . checked( 1, $checked, false ) . '/>' ;
733
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Search approved comment content", 'add-search-to-menu' ) . '</label></p>' ;
734
  ?>
735
  </div></div>
736
 
737
  <h4 scope="row">
738
  <label for="<?php
739
- echo $id ;
740
  ?>-has_password"><?php
741
  echo esc_html( __( 'Password Protected', 'add-search-to-menu' ) ) ;
742
  ?></label>
@@ -744,17 +746,17 @@ class IS_Search_Editor
744
  <div><div>
745
  <?php
746
  $checked = ( isset( $includes['has_password'] ) ? $includes['has_password'] : 'null' );
747
- echo '<p class="check-radio"><label for="' . $id . '-has_password" ><input class="_is_includes-has_password" type="radio" id="' . $id . '-has_password" name="' . $id . '[has_password]" value="null" ' . checked( 'null', $checked, false ) . '/>' ;
748
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Search posts with or without passwords", 'add-search-to-menu' ) . '</label></p>' ;
749
- echo '<p class="check-radio"><label for="' . $id . '-has_password_1" ><input class="_is_includes-has_password" type="radio" id="' . $id . '-has_password_1" name="' . $id . '[has_password]" value="1" ' . checked( 1, $checked, false ) . '/>' ;
750
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Search posts with passwords", 'add-search-to-menu' ) . '</label></p>' ;
751
- echo '<p class="check-radio"><label for="' . $id . '-has_password_0" ><input class="_is_includes-has_password" type="radio" id="' . $id . '-has_password_0" name="' . $id . '[has_password]" value="0" ' . checked( 0, $checked, false ) . '/>' ;
752
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Search posts without passwords", 'add-search-to-menu' ) . '</label></p>' ;
753
  ?>
754
  </div></div>
755
  <h4 scope="row">
756
  <label for="<?php
757
- echo $id ;
758
  ?>-date_query"><?php
759
  echo esc_html( __( 'Date', 'add-search-to-menu' ) ) ;
760
  ?></label>
@@ -767,9 +769,9 @@ class IS_Search_Editor
767
  $range = array( 'after', 'before' );
768
  foreach ( $range as $value ) {
769
  $col_title = ( 'after' == $value ? __( 'From', 'add-search-to-menu' ) : __( 'To', 'add-search-to-menu' ) );
770
- echo '<div class="col-wrapper ' . $value . '"><div class="col-title">' . $col_title . '</div>' ;
771
  $checked = ( isset( $includes['date_query'][$value]['date'] ) ? $includes['date_query'][$value]['date'] : '' );
772
- echo '<input type="text" id="is-' . $value . '-datepicker" name="' . $id . '[date_query][' . $value . '][date]" value="' . $checked . '">' ;
773
  echo '</div>' ;
774
  }
775
  ?>
@@ -861,8 +863,8 @@ class IS_Search_Editor
861
  <div>
862
  <?php
863
 
864
- if ( isset( $_GET['post'] ) ) {
865
- $customizer_url = admin_url( 'customize.php?autofocus[section]=is_section_' . $_GET['post'] );
866
  if ( !$enable_customize ) {
867
  $customizer_url = "//" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
868
  }
@@ -1802,7 +1804,7 @@ class IS_Search_Editor
1802
  ?>
1803
  </h4>
1804
  <div class="search-form-editor-box" id="<?php
1805
- echo $id ;
1806
  ?>">
1807
  <div class="form-table form-table-panel-excludes">
1808
 
@@ -1832,9 +1834,11 @@ class IS_Search_Editor
1832
  ?>
1833
  <h3 scope="row">
1834
  <label for="<?php
1835
- echo $id ;
1836
  ?>-post__not_in"><?php
1837
- echo $accord_title ;
 
 
1838
  ?></label>
1839
  <?php
1840
 
@@ -1895,10 +1899,10 @@ class IS_Search_Editor
1895
  $col_title = '<strong>' . $col_title . '</strong>';
1896
  }
1897
  $html .= $col_title . '<input class="list-search" placeholder="' . __( "Search..", 'add-search-to-menu' ) . '" type="text"></div>';
1898
- $html .= '<select class="_is_excludes-post__not_in" name="' . $id . '[post__not_in][]" multiple size="8" >';
1899
  $html .= $temp . '</select>';
1900
  if ( count( $posts ) >= 100 && !defined( 'DISABLE_IS_LOAD_ALL' ) && !isset( $excludes['post__not_in'] ) ) {
1901
- $html .= '<div id="' . $post_type . '" class="load-all">' . __( 'Load All', 'add-search-to-menu' ) . '</div>';
1902
  }
1903
  $html .= '</div>';
1904
  }
@@ -1907,7 +1911,7 @@ class IS_Search_Editor
1907
  if ( !$posts_found ) {
1908
  $html .= '<br /><span class="notice-is-info">' . sprintf( __( 'No %s created.', 'add-search-to-menu' ), $post_types2[$post_type]->labels->name ) . '</span>';
1909
  } else {
1910
- $html .= '<br /><label for="' . $id . '-post__not_in" class="ctrl-multi-select">' . esc_html__( "Hold down the control (ctrl) or command button to select multiple options.", 'add-search-to-menu' ) . '</label><br />';
1911
  }
1912
 
1913
  $html .= '</div>';
@@ -1924,9 +1928,9 @@ class IS_Search_Editor
1924
  continue;
1925
  }
1926
 
1927
- echo '<p class="check-radio"><label for="' . $post_type . '-post-search_all" ><input class="is-post-select" type="radio" id="' . $post_type . '-post-search_all" name="' . $post_type . 'i[post_search_radio]" value="all" ' . checked( 'all', $checked, false ) . '/>' ;
1928
  echo '<span class="toggle-check-text"></span>' . sprintf( esc_html__( "Do not exclude any %s from search", 'add-search-to-menu' ), strtolower( $post_types2[$post_type]->labels->singular_name ) ) . '</label></p>' ;
1929
- echo '<p class="check-radio"><label for="' . $post_type . '-post-search_selected" ><input class="is-post-select" type="radio" id="' . $post_type . '-post-search_selected" name="' . $post_type . 'i[post_search_radio]" value="selected" ' . checked( 'selected', $checked, false ) . '/>' ;
1930
  echo '<span class="toggle-check-text"></span>' . sprintf( esc_html__( "Exclude selected %s from search", 'add-search-to-menu' ), strtolower( $post_types2[$post_type]->labels->name ) ) . '</label></p>' ;
1931
  echo $html ;
1932
  } else {
@@ -1955,7 +1959,7 @@ class IS_Search_Editor
1955
  $selected_tax = true;
1956
  }
1957
 
1958
- $html .= $col_title . '<input class="list-search" placeholder="' . __( "Search..", 'add-search-to-menu' ) . '" type="text"></div><select class="_is_excludes-tax_query" name="' . $id . '[tax_query][' . $key . '][]" multiple size="8" >';
1959
  foreach ( $terms as $key2 => $term ) {
1960
  $checked = ( isset( $excludes['tax_query'][$key] ) && in_array( $term->term_taxonomy_id, $excludes['tax_query'][$key] ) ? $term->term_taxonomy_id : 0 );
1961
  $html .= '<option value="' . esc_attr( $term->term_taxonomy_id ) . '" ' . selected( $term->term_taxonomy_id, $checked, false ) . '>' . esc_html( $term->name ) . '</option>';
@@ -1964,17 +1968,17 @@ class IS_Search_Editor
1964
  }
1965
 
1966
  }
1967
- $html .= '<br /><label for="' . $id . '-tax_query" class="ctrl-multi-select">' . esc_html__( "Hold down the control (ctrl) or command button to select multiple options.", 'add-search-to-menu' ) . '</label><br />';
1968
  $html .= '</div>';
1969
  $checked = ( $selected_tax ? 'selected' : 'all' );
1970
- echo '<br /><p class="check-radio"><label for="' . $post_type . '-tax-search_all" ><input class="is-tax-select" type="radio" id="' . $post_type . '-tax-search_all" name="' . $post_type . 'i[tax_search_radio]" value="all" ' . checked( 'all', $checked, false ) . '/>' ;
1971
  echo '<span class="toggle-check-text"></span>' . sprintf(
1972
  esc_html__( "Do not exclude any %s from search of any taxonomies (%s categories, tags & terms %s)", 'add-search-to-menu' ),
1973
  strtolower( $post_types2[$post_type]->labels->singular_name ),
1974
  '<i>',
1975
  '</i>'
1976
  ) . '</label></p>' ;
1977
- echo '<p class="check-radio"><label for="' . $post_type . '-tax-search_selected" ><input class="is-tax-select" type="radio" id="' . $post_type . '-tax-search_selected" name="' . $post_type . 'i[tax_search_radio]" value="selected" ' . checked( 'selected', $checked, false ) . '/>' ;
1978
  echo '<span class="toggle-check-text"></span>' . sprintf(
1979
  esc_html__( "Exclude %s from search of selected taxonomies (%s categories, tags & terms %s)", 'add-search-to-menu' ),
1980
  strtolower( $post_types2[$post_type]->labels->name ),
@@ -1991,7 +1995,7 @@ class IS_Search_Editor
1991
  $selected_meta = false;
1992
  $custom_field_disable = ( is_fs()->is_plan_or_trial( 'pro' ) && $this->is_premium_plugin ? '' : ' disabled ' );
1993
  $html .= '<input class="list-search wide" placeholder="' . __( "Search..", 'add-search-to-menu' ) . '" type="text">';
1994
- $html .= '<select class="_is_excludes-custom_field" name="' . $id . '[custom_field][]" ' . $custom_field_disable . ' multiple size="8" >';
1995
  foreach ( $meta_keys as $meta_key ) {
1996
  $checked = ( isset( $excludes['custom_field'] ) && in_array( $meta_key, $excludes['custom_field'] ) ? $meta_key : 0 );
1997
  if ( $checked ) {
@@ -2001,10 +2005,10 @@ class IS_Search_Editor
2001
  }
2002
  $html .= '</select>';
2003
  $html .= IS_Admin::pro_link();
2004
- $html .= '<br /><label for="' . $id . '-custom_field" class="ctrl-multi-select">' . esc_html__( "Hold down the control (ctrl) or command button to select multiple options.", 'add-search-to-menu' ) . '</label><br />';
2005
  $html .= '</div>';
2006
  $checked = ( $selected_meta ? 'selected' : 'all' );
2007
- echo '<br /><p class="check-radio"><label for="' . $post_type . '-meta-search_selected" ><input class="is-meta-select" type="checkbox" id="' . $post_type . '-meta-search_selected" name="' . $post_type . 'i[meta_search_radio]" value="selected" ' . checked( 'selected', $checked, false ) . '/>' ;
2008
  echo '<span class="toggle-check-text"></span>' . sprintf( esc_html__( "Exclude %s from search having selected custom fields", 'add-search-to-menu' ), strtolower( $post_types2[$post_type]->labels->name ) ) . '</label></p>' ;
2009
  echo $html ;
2010
  }
@@ -2017,7 +2021,7 @@ class IS_Search_Editor
2017
  echo '<br /><div class="upgrade-parent">' ;
2018
  }
2019
  $checked = ( isset( $excludes['woo']['outofstock'] ) && $excludes['woo']['outofstock'] ? 1 : 0 );
2020
- echo '<p class="check-radio"><label for="' . $id . '-outofstock" ><input class="_is_excludes-woocommerce" type="checkbox" ' . $outofstock_disable . ' id="' . $id . '-outofstock" name="' . $id . '[woo][outofstock]" value="1" ' . checked( 1, $checked, false ) . '/>' ;
2021
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Exclude 'Out of Stock' products from search", 'add-search-to-menu' ) . '</label></p>' ;
2022
  echo IS_Admin::pro_link( 'pro_plus' ) ;
2023
  if ( '' !== $outofstock_disable ) {
@@ -2043,14 +2047,14 @@ class IS_Search_Editor
2043
  ksort( $file_types );
2044
  $html = '<br /><div class="is-mime">';
2045
  $html .= '<input class="list-search wide" placeholder="' . __( "Search..", 'add-search-to-menu' ) . '" type="text">';
2046
- $html .= '<select class="_is_excludes-post_file_type" name="' . $id . '[post_file_type][]" ' . $file_type_disable . ' multiple size="8" >';
2047
  foreach ( $file_types as $key => $file_type ) {
2048
  $checked = ( isset( $excludes['post_file_type'] ) && in_array( $file_type, $excludes['post_file_type'] ) ? $file_type : 0 );
2049
  $html .= '<option value="' . esc_attr( $file_type ) . '" ' . selected( $file_type, $checked, false ) . '>' . esc_html( $key ) . '</option>';
2050
  }
2051
  $html .= '</select>';
2052
  echo IS_Admin::pro_link( 'pro_plus' ) ;
2053
- $html .= '<br /><label for="' . $id . '-post_file_type" class="ctrl-multi-select">' . esc_html__( "Hold down the control (ctrl) or command button to select multiple options.", 'add-search-to-menu' ) . '</label><br />';
2054
 
2055
  if ( isset( $excludes['post_file_type'] ) ) {
2056
  $html .= __( 'Excluded File Types :', 'add-search-to-menu' );
@@ -2067,17 +2071,17 @@ class IS_Search_Editor
2067
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Exclude selected MIME types from search", 'add-search-to-menu' ) . '</label></p>' ;
2068
  echo $html ;
2069
  echo '<span class="search-attachments-wrapper">' ;
2070
- echo '<p class="check-radio"><label for="' . $id . '-search_images"><input class="search-attachments exclude" type="checkbox" id="' . $id . '-search_images" name="search_images" value="1" />' ;
2071
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Exclude Images", 'add-search-to-menu' ) . '</label></p>' ;
2072
- echo '<p class="check-radio"><label for="' . $id . '-search_videos"><input class="search-attachments exclude" type="checkbox" id="' . $id . '-search_videos" name="search_videos" value="1" />' ;
2073
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Exclude Videos", 'add-search-to-menu' ) . '</label></p>' ;
2074
- echo '<p class="check-radio"><label for="' . $id . '-search_audios"><input class="search-attachments exclude" type="checkbox" id="' . $id . '-search_audios" name="search_audios" value="1" />' ;
2075
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Exclude Audios", 'add-search-to-menu' ) . '</label></p>' ;
2076
- echo '<p class="check-radio"><label for="' . $id . '-search_text"><input class="search-attachments exclude" type="checkbox" id="' . $id . '-search_text" name="search_text" value="1" />' ;
2077
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Exclude Text Files", 'add-search-to-menu' ) . '</label></p>' ;
2078
- echo '<p class="check-radio"><label for="' . $id . '-search_pdfs"><input class="search-attachments exclude" type="checkbox" id="' . $id . '-search_pdfs" name="search_pdfs" value="1" />' ;
2079
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Exclude PDF Files", 'add-search-to-menu' ) . '</label></p>' ;
2080
- echo '<p class="check-radio"><label for="' . $id . '-search_docs"><input class="search-attachments exclude" type="checkbox" id="' . $id . '-search_docs" name="search_docs" value="1" />' ;
2081
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Exclude Document Files", 'add-search-to-menu' ) . '</label></p>' ;
2082
  echo '</span>' ;
2083
  if ( '' !== $file_type_disable ) {
@@ -2103,7 +2107,7 @@ class IS_Search_Editor
2103
  ?>
2104
  <h3 scope="row">
2105
  <label for="<?php
2106
- echo $id ;
2107
  ?>-extras"><?php
2108
  echo esc_html( __( 'Extras', 'add-search-to-menu' ) ) ;
2109
  ?></label>
@@ -2116,7 +2120,7 @@ class IS_Search_Editor
2116
  <div>
2117
  <h4 scope="row" class="is-first-title">
2118
  <label for="<?php
2119
- echo $id ;
2120
  ?>-author"><?php
2121
  echo esc_html( __( 'Authors', 'add-search-to-menu' ) ) ;
2122
  ?></label>
@@ -2165,7 +2169,7 @@ class IS_Search_Editor
2165
  continue;
2166
  }
2167
  $checked = ( isset( $excludes['author'][esc_attr( $author->ID )] ) ? $excludes['author'][esc_attr( $author->ID )] : 0 );
2168
- echo '<label for="' . $id . '-author-' . esc_attr( $author->ID ) . '"><input class="_is_excludes-author" type="checkbox" ' . $author_disable . ' id="' . $id . '-author-' . esc_attr( $author->ID ) . '" name="' . $id . '[author][' . esc_attr( $author->ID ) . ']" value="' . esc_attr( $author->ID ) . '" ' . checked( $author->ID, $checked, false ) . '/>' ;
2169
  echo '<span class="toggle-check-text"></span> ' . ucfirst( esc_html( $author->display_name ) ) . '</label>' ;
2170
  }
2171
  echo '</div></div>' ;
@@ -2180,7 +2184,7 @@ class IS_Search_Editor
2180
 
2181
  <h4 scope="row">
2182
  <label for="<?php
2183
- echo $id ;
2184
  ?>-post_status"><?php
2185
  echo esc_html( __( 'Post Status', 'add-search-to-menu' ) ) ;
2186
  ?></label>
@@ -2191,7 +2195,7 @@ class IS_Search_Editor
2191
  IS_Help::help_info( $content );
2192
  echo '<div>' ;
2193
  $checked = ( isset( $excludes['ignore_sticky_posts'] ) && $excludes['ignore_sticky_posts'] ? 1 : 0 );
2194
- echo '<label for="' . $id . '-ignore_sticky_posts" ><input class="_is_excludes-post_status" type="checkbox" id="' . $id . '-ignore_sticky_posts" name="' . $id . '[ignore_sticky_posts]" value="1" ' . checked( 1, $checked, false ) . '/>' ;
2195
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Exclude sticky posts from search", 'add-search-to-menu' ) . '</label>' ;
2196
  ?>
2197
  </div></div>
@@ -2212,13 +2216,13 @@ class IS_Search_Editor
2212
  ?>
2213
  </h4>
2214
  <div class="search-form-editor-box" id="<?php
2215
- echo $id ;
2216
  ?>">
2217
  <div class="form-table form-table-panel-options">
2218
 
2219
  <h3 scope="row">
2220
  <label for="<?php
2221
- echo $id ;
2222
  ?>-posts_per_page"><?php
2223
  echo esc_html( __( 'Posts Per Page', 'add-search-to-menu' ) ) ;
2224
  ?></label>
@@ -2232,7 +2236,7 @@ class IS_Search_Editor
2232
  $content = __( 'Display selected number of posts in search results.', 'add-search-to-menu' );
2233
  IS_Help::help_info( $content );
2234
  echo '<div>' ;
2235
- echo '<select class="_is_settings-posts_per_page" name="' . $id . '[posts_per_page]" >' ;
2236
  $default_per_page = get_option( 'posts_per_page', 10 );
2237
  $checked = ( isset( $settings['posts_per_page'] ) ? $settings['posts_per_page'] : $default_per_page );
2238
  for ( $d = 1 ; $d <= 1000 ; $d++ ) {
@@ -2247,7 +2251,7 @@ class IS_Search_Editor
2247
 
2248
  <h3 scope="row">
2249
  <label for="<?php
2250
- echo $id ;
2251
  ?>-order"><?php
2252
  echo esc_html( __( 'Order Search Results', 'add-search-to-menu' ) ) ;
2253
  ?></label>
@@ -2257,7 +2261,7 @@ class IS_Search_Editor
2257
  IS_Help::help_info( $content );
2258
  echo '<div>' ;
2259
  $orderby_disable = ( is_fs()->is_plan_or_trial( 'pro' ) && $this->is_premium_plugin ? '' : ' disabled ' );
2260
- echo '<select class="_is_settings-order" name="' . $id . '[orderby]" ' . $orderby_disable . ' >' ;
2261
  $checked = ( isset( $settings['orderby'] ) ? $settings['orderby'] : 'date' );
2262
  $orderbys = array(
2263
  'date',
@@ -2282,7 +2286,7 @@ class IS_Search_Editor
2282
  foreach ( $orderbys as $orderby ) {
2283
  echo '<option value="' . $orderby . '" ' . selected( $orderby, $checked, false ) . '>' . ucwords( str_replace( '_', ' ', esc_html( $orderby ) ) ) . '</option>' ;
2284
  }
2285
- echo '</select><select class="_is_settings-order" name="' . $id . '[order]" ' . $orderby_disable . ' >' ;
2286
  $checked = ( isset( $settings['order'] ) ? $settings['order'] : 'DESC' );
2287
  $orders = array( 'DESC', 'ASC' );
2288
  foreach ( $orders as $order ) {
@@ -2296,7 +2300,7 @@ class IS_Search_Editor
2296
 
2297
  <h3 scope="row">
2298
  <label for="<?php
2299
- echo $id ;
2300
  ?>-highlight_terms"><?php
2301
  echo esc_html( __( 'Highlight Search Terms', 'add-search-to-menu' ) ) ;
2302
  ?></label>
@@ -2304,10 +2308,10 @@ class IS_Search_Editor
2304
  <div><div>
2305
  <?php
2306
  $checked = ( isset( $settings['highlight_terms'] ) && $settings['highlight_terms'] ? 1 : 0 );
2307
- echo '<p class="check-radio"><label for="' . $id . '-highlight_terms" ><input class="_is_settings-highlight_terms" type="checkbox" id="' . $id . '-highlight_terms" name="' . $id . '[highlight_terms]" value="1" ' . checked( 1, $checked, false ) . '/>' ;
2308
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Highlight searched terms on search results page", 'add-search-to-menu' ) . '</label></p>' ;
2309
  $color = ( isset( $settings['highlight_color'] ) ? $settings['highlight_color'] : '#FFFFB9' );
2310
- echo '<div class="highlight-container"><br /><input style="width: 80px;" class="_is_settings-highlight_terms is-colorpicker" size="5" type="text" id="' . $id . '-highlight_color" name="' . $id . '[highlight_color]" value="' . $color . '" />' ;
2311
  echo '<br /><i> ' . esc_html__( "Select text highlight color", 'add-search-to-menu' ) . '</i></div>' ;
2312
  ?>
2313
  </div></div>
@@ -2315,7 +2319,7 @@ class IS_Search_Editor
2315
 
2316
  <h3 scope="row">
2317
  <label for="<?php
2318
- echo $id ;
2319
  ?>-term_rel"><?php
2320
  echo esc_html( __( 'Search All Or Any Search Terms', 'add-search-to-menu' ) ) ;
2321
  ?></label>
@@ -2326,9 +2330,9 @@ class IS_Search_Editor
2326
  IS_Help::help_info( $content );
2327
  echo '<div>' ;
2328
  $checked = ( isset( $settings['term_rel'] ) && "OR" === $settings['term_rel'] ? "OR" : "AND" );
2329
- echo '<p class="check-radio"><label for="' . $id . '-term_rel_or" ><input class="_is_settings-term_rel" type="radio" id="' . $id . '-term_rel_or" name="' . $id . '[term_rel]" value="OR" ' . checked( 'OR', $checked, false ) . '/>' ;
2330
  echo '<span class="toggle-check-text"></span>' . esc_html__( "OR - Display content having any of the search terms", 'add-search-to-menu' ) . '</label></p>' ;
2331
- echo '<p class="check-radio"><label for="' . $id . '-term_rel_and" ><input class="_is_settings-term_rel" type="radio" id="' . $id . '-term_rel_and" name="' . $id . '[term_rel]" value="AND" ' . checked( 'AND', $checked, false ) . '/>' ;
2332
  echo '<span class="toggle-check-text"></span>' . esc_html__( "AND - Display content having all the search terms", 'add-search-to-menu' ) . '</label></p>' ;
2333
  ?>
2334
  </div></div>
@@ -2336,7 +2340,7 @@ class IS_Search_Editor
2336
 
2337
  <h3 scope="row">
2338
  <label for="<?php
2339
- echo $id ;
2340
  ?>-fuzzy_match"><?php
2341
  echo esc_html( __( 'Fuzzy Matching', 'add-search-to-menu' ) ) ;
2342
  ?></label>
@@ -2346,9 +2350,9 @@ class IS_Search_Editor
2346
  IS_Help::help_info( $content );
2347
  echo '<div>' ;
2348
  $checked = ( isset( $settings['fuzzy_match'] ) ? $settings['fuzzy_match'] : '2' );
2349
- echo '<p class="check-radio"><label for="' . $id . '-whole" ><input class="_is_settings-fuzzy_match" type="radio" id="' . $id . '-whole" name="' . $id . '[fuzzy_match]" value="1" ' . checked( '1', $checked, false ) . '/>' ;
2350
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Whole - Search posts that include the whole search term", 'add-search-to-menu' ) . '</label></p>' ;
2351
- echo '<p class="check-radio"><label for="' . $id . '-partial" ><input class="_is_settings-fuzzy_match" type="radio" id="' . $id . '-partial" name="' . $id . '[fuzzy_match]" value="2" ' . checked( '2', $checked, false ) . '/>' ;
2352
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Partial - Also search words in the posts that begins or ends with the search term", 'add-search-to-menu' ) . '</label></p>' ;
2353
  ?>
2354
  </div></div>
@@ -2356,7 +2360,7 @@ class IS_Search_Editor
2356
 
2357
  <h3 scope="row">
2358
  <label for="<?php
2359
- echo $id ;
2360
  ?>-keyword_stem"><?php
2361
  echo esc_html( __( 'Keyword Stemming', 'add-search-to-menu' ) ) ;
2362
  ?></label>
@@ -2370,7 +2374,7 @@ class IS_Search_Editor
2370
  echo '<div>' ;
2371
  $stem_disable = ( is_fs()->is_plan_or_trial( 'pro_plus' ) && $this->is_premium_plugin ? '' : ' disabled ' );
2372
  $checked = ( isset( $settings['keyword_stem'] ) && $settings['keyword_stem'] ? 1 : 0 );
2373
- echo '<p class="check-radio"><label for="' . $id . '-keyword_stem" ><input class="_is_settings-keyword_stem" type="checkbox" id="' . $id . '-keyword_stem" ' . $stem_disable . ' name="' . $id . '[keyword_stem]" value="1" ' . checked( 1, $checked, false ) . '/>' ;
2374
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Also search base word of searched keyword", 'add-search-to-menu' ) . '</label></p>' ;
2375
  echo IS_Admin::pro_link( 'pro_plus' ) ;
2376
  ?>
@@ -2379,7 +2383,7 @@ class IS_Search_Editor
2379
 
2380
  <h3 scope="row">
2381
  <label for="<?php
2382
- echo $id ;
2383
  ?>-extras"><?php
2384
  echo esc_html( __( 'Others', 'add-search-to-menu' ) ) ;
2385
  ?></label>
@@ -2391,19 +2395,19 @@ class IS_Search_Editor
2391
  <div><div>
2392
  <?php
2393
  $checked = ( isset( $settings['move_sticky_posts'] ) && $settings['move_sticky_posts'] ? 1 : 0 );
2394
- echo '<p class="check-radio"><label for="' . $id . '-move_sticky_posts" ><input class="_is_settings-move_sticky_posts" type="checkbox" id="' . $id . '-move_sticky_posts" name="' . $id . '[move_sticky_posts]" value="1" ' . checked( 1, $checked, false ) . '/>' ;
2395
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Display sticky posts to the start of the search results page", 'add-search-to-menu' ) . '</label></p>' ;
2396
  $checked = ( isset( $settings['demo'] ) && $settings['demo'] ? 1 : 0 );
2397
- echo '<p class="check-radio"><label for="' . $id . '-demo" ><input class="_is_settings-demo" type="checkbox" id="' . $id . '-demo" name="' . $id . '[demo]" value="1" ' . checked( 1, $checked, false ) . '/>' ;
2398
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Display search form only for site administrator", 'add-search-to-menu' ) . '</label></p>' ;
2399
  $checked = ( isset( $settings['disable'] ) && $settings['disable'] ? 1 : 0 );
2400
- echo '<p class="check-radio"><label for="' . $id . '-disable" ><input class="_is_settings-disable" type="checkbox" id="' . $id . '-disable" name="' . $id . '[disable]" value="1" ' . checked( 1, $checked, false ) . '/>' ;
2401
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Disable this search form", 'add-search-to-menu' ) . '</label></p>' ;
2402
  echo '<br /><p class="check-radio">' ;
2403
  $content = __( 'Select whether to display an error when user perform search without any search word.', 'add-search-to-menu' );
2404
  IS_Help::help_info( $content );
2405
  $checked = ( isset( $settings['empty_search'] ) && $settings['empty_search'] ? 1 : 0 );
2406
- echo '<br /><label for="' . $id . '-empty_search" ><input class="_is_settings-empty_search" type="checkbox" id="' . $id . '-empty_search" name="' . $id . '[empty_search]" value="1" ' . checked( 1, $checked, false ) . '/>' ;
2407
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Display an error for empty search query", 'add-search-to-menu' ) . '</label></p>' ;
2408
  ?>
2409
  </div></div>
37
  return;
38
  }
39
  echo '<ul id="search-form-editor-tabs">' ;
40
+ $url = menu_page_url( 'ivory-search-new', false );
41
  if ( isset( $_GET['post'] ) && is_numeric( $_GET['post'] ) ) {
42
+ $url = menu_page_url( 'ivory-search', false ) . '&post=' . esc_url_raw( $_GET['post'] ) . '&action=edit';
43
  }
44
  $tab = 'includes';
45
  if ( isset( $_GET['tab'] ) ) {
64
  '<li id="%1$s-tab" class="%2$s"><a href="%3$s" title="%4$s">%5$s</a></li>',
65
  esc_attr( $id ),
66
  esc_attr( $class ),
67
+ esc_url( $url ) . '&tab=' . esc_url_raw( $id ),
68
  esc_attr( $panel['description'] ),
69
  esc_html( $panel['title'] )
70
  ) ;
121
  }
122
 
123
  if ( isset( $_REQUEST['post'] ) ) {
124
+ $includes_url = '<a href="' . esc_url( menu_page_url( 'ivory-search', false ) . '&post=' . esc_url_raw( $_REQUEST['post'] ) . '&action=edit&tab=' . esc_url_raw( $section ) ) . '">' . esc_html( $sec_name ) . '</a>';
125
  } else {
126
  if ( isset( $_REQUEST['page'] ) && 'ivory-search-new' === $_REQUEST['page'] ) {
127
+ $includes_url = '<a href="' . esc_url( menu_page_url( 'ivory-search-new', false ) . '&tab=' . esc_url_raw( $section ) ) . '">' . esc_html( $sec_name ) . '</a>';
128
  }
129
  }
130
 
145
  ?>
146
  </h4>
147
  <div class="search-form-editor-box" id="<?php
148
+ esc_attr_e( $id );
149
  ?>">
150
 
151
  <div class="form-table form-table-panel-includes">
152
 
153
  <h3 scope="row">
154
  <label for="<?php
155
+ esc_attr_e( $id );
156
  ?>-post_type"><?php
157
  esc_html_e( 'Post Types', 'add-search-to-menu' );
158
  ?></label>
194
  echo '<span style="display:none;" class="is-cb-select">' . __( 'Select Post Types', 'add-search-to-menu' ) . '</span><span class="is-cb-titles">' ;
195
  foreach ( $post_types2 as $post_type2 ) {
196
  if ( isset( $post_types[$post_type2] ) ) {
197
+ echo '<span title="' . esc_attr( $post_type2 ) . '"> ' . esc_html( $post_types[$post_type2]->labels->name ) . '</span>' ;
198
  }
199
  }
200
  echo '</span>' ;
204
  echo '<div class="is-cb-multisel">' ;
205
  foreach ( $post_types as $key => $post_type ) {
206
  $checked = ( $default_search && in_array( $key, $post_types2 ) || isset( $includes['post_type'][esc_attr( $key )] ) ? esc_attr( $key ) : 0 );
207
+ echo '<label for="' . esc_attr( $id ) . '-post_type-' . esc_attr( $key ) . '"> ' ;
208
+ echo '<input class="_is_includes-post_type" type="checkbox" id="' . esc_attr( $id ) . '-post_type-' . esc_attr( $key ) . '" name="' . esc_attr( $id ) . '[post_type][' . esc_attr( $key ) . ']" value="' . esc_attr( $key ) . '" ' . checked( $key, $checked, false ) . '/>' ;
209
  echo '<span class="toggle-check-text"></span>' ;
210
  echo ucfirst( esc_html( $post_type->labels->name ) ) . '</label>' ;
211
  }
217
 
218
  if ( isset( $includes['post_type'] ) && is_array( $includes['post_type'] ) && 1 == count( $includes['post_type'] ) ) {
219
  $checked = ( isset( $includes['post_type_url'] ) ? 'y' : 'n' );
220
+ echo '<br /><p class="check-radio"><label for="' . esc_attr( $id ) . '-post_type_url"><input class="_is_includes-post_type_url" type="checkbox" id="' . esc_attr( $id ) . '-post_type_url" name="' . esc_attr( $id ) . '[post_type_url]" value="y" ' . checked( 'y', $checked, false ) . '/>' ;
221
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Do not display post_type in the search URL", 'add-search-to-menu' ) . '</label></p>' ;
222
  }
223
 
242
  ?>
243
 
244
  <h3 scope="row" class="is-p-type post-type-<?php
245
+ esc_attr_e( $post_type );
246
  ?>">
247
  <label for="<?php
248
+ esc_attr_e( $id );
249
  ?>-post__in"><?php
250
+ echo wp_kses( $accord_title, array(
251
+ 'i' => array(),
252
+ ) ) ;
253
  ?></label>
254
  </h3>
255
  <div class="post-type-<?php
256
+ esc_attr_e( $post_type );
257
  ?>">
258
  <?php
259
  echo '<div>' ;
278
  if ( !empty($posts) ) {
279
  $posts_found = true;
280
  $html .= '<div class="col-wrapper"><div class="col-title">';
281
+ $col_title = '<span>' . esc_html( $post_types[$post_type]->labels->name ) . '</span>';
282
  $temp = '';
283
  foreach ( $posts as $post2 ) {
284
  $checked = ( isset( $includes['post__in'] ) && in_array( $post2->ID, $includes['post__in'] ) ? $post2->ID : 0 );
292
  $col_title = '<strong>' . $col_title . '</strong>';
293
  }
294
  $html .= $col_title . '<input class="list-search" placeholder="' . __( "Search..", 'add-search-to-menu' ) . '" type="text"></div>';
295
+ $html .= '<select class="_is_includes-post__in" name="' . esc_attr( $id ) . '[post__in][]" multiple size="8" >';
296
  $html .= $temp . '</select>';
297
  if ( count( $posts ) >= 100 && !defined( 'DISABLE_IS_LOAD_ALL' ) && !isset( $includes['post__in'] ) ) {
298
+ $html .= '<div id="' . esc_attr( $post_type ) . '" class="load-all">' . __( 'Load All', 'add-search-to-menu' ) . '</div>';
299
  }
300
  $html .= '</div><br />';
301
  }
304
  if ( !$posts_found ) {
305
  $html .= '<span class="notice-is-info">' . sprintf( __( 'No %s created.', 'add-search-to-menu' ), $post_types[$post_type]->labels->name ) . '</span>';
306
  } else {
307
+ $html .= '<label for="' . esc_attr( $id ) . '-post__in" class="ctrl-multi-select">' . esc_html__( "Hold down the control (ctrl) or command button to select multiple options.", 'add-search-to-menu' ) . '</label><br />';
308
  }
309
 
310
  $html .= '</div>';
314
  $checked = 'selected';
315
  } else {
316
  if ( isset( $includes['post__in'] ) ) {
317
+ echo '<span class="notice-is-info">' . sprintf( __( 'The %s are not searchable as the search form is configured to only search specific posts of another post type.', 'add-search-to-menu' ), strtolower( esc_html( $post_types[$post_type]->labels->name ) ) ) . '</span><br /><br />' ;
318
  }
319
  }
320
 
321
 
322
  if ( $posts_found ) {
323
+ echo '<p class="check-radio"><label for="' . esc_attr( $post_type ) . '-post-search_all" ><input class="is-post-select" type="radio" id="' . esc_attr( $post_type ) . '-post-search_all" name="' . esc_attr( $post_type ) . 'i[post_search_radio]" value="all" ' . checked( 'all', $checked, false ) . '/>' ;
324
+ echo '<span class="toggle-check-text"></span>' . sprintf( esc_html__( "Search all %s", 'add-search-to-menu' ), strtolower( esc_html( $post_types[$post_type]->labels->name ) ) ) . '</label></p>' ;
325
+ echo '<p class="check-radio"><label for="' . esc_attr( $post_type ) . '-post-search_selected" ><input class="is-post-select" type="radio" id="' . esc_attr( $post_type ) . '-post-search_selected" name="' . esc_attr( $post_type ) . 'i[post_search_radio]" value="selected" ' . checked( 'selected', $checked, false ) . '/>' ;
326
+ echo '<span class="toggle-check-text"></span>' . sprintf( esc_html__( "Search only selected %s", 'add-search-to-menu' ), strtolower( esc_html( $post_types[$post_type]->labels->name ) ) ) . '</label></p>' ;
327
  }
328
 
329
+ echo wp_kses_post( $html ) ;
330
  $tax_objs = get_object_taxonomies( $post_type, 'objects' );
331
 
332
  if ( !empty($tax_objs) ) {
349
  $selected_tax = true;
350
  }
351
 
352
+ $html .= $col_title . '<input class="list-search" placeholder="' . __( "Search..", 'add-search-to-menu' ) . '" type="text"></div><input type="hidden" id="' . esc_attr( $id ) . '-tax_post_type" name="' . esc_attr( $id ) . '[tax_post_type][' . $key . ']" value="' . implode( ',', $tax_obj->object_type ) . '" />';
353
+ $html .= '<select class="_is_includes-tax_query" name="' . esc_attr( $id ) . '[tax_query][' . $key . '][]" multiple size="8" >';
354
  foreach ( $terms as $key2 => $term ) {
355
  $checked = ( isset( $includes['tax_query'][$key] ) && in_array( $term->term_taxonomy_id, $includes['tax_query'][$key] ) ? $term->term_taxonomy_id : 0 );
356
  $html .= '<option value="' . esc_attr( $term->term_taxonomy_id ) . '" ' . selected( $term->term_taxonomy_id, $checked, false ) . '>' . esc_html( $term->name ) . '</option>';
361
  }
362
 
363
  if ( $terms_exist ) {
364
+ $html .= '<br /><label for="' . esc_attr( $id ) . '-tax_query" class="ctrl-multi-select">' . esc_html__( "Hold down the control (ctrl) or command button to select multiple options.", 'add-search-to-menu' ) . '</label><br />';
365
  $html .= '</div>';
366
  $checked = ( $selected_tax ? 'selected' : 'all' );
367
+ echo '<br /><p class="check-radio"><label for="' . esc_attr( $post_type ) . '-tax-search_all" ><input class="is-tax-select" type="radio" id="' . esc_attr( $post_type ) . '-tax-search_all" name="' . esc_attr( $post_type ) . 'i[tax_search_radio]" value="all" ' . checked( 'all', $checked, false ) . '/>' ;
368
  echo '<span class="toggle-check-text"></span>' . sprintf(
369
  esc_html__( "Search %s of all taxonomies (%s categories, tags & terms %s)", 'add-search-to-menu' ),
370
  strtolower( $post_types[$post_type]->labels->name ),
371
  '<i>',
372
  '</i>'
373
  ) . '</label></p>' ;
374
+ echo '<p class="check-radio"><label for="' . esc_attr( $post_type ) . '-tax-search_selected" ><input class="is-tax-select" type="radio" id="' . esc_attr( $post_type ) . '-tax-search_selected" name="' . esc_attr( $post_type ) . 'i[tax_search_radio]" value="selected" ' . checked( 'selected', $checked, false ) . '/>' ;
375
  echo '<span class="toggle-check-text"></span>' . sprintf(
376
  esc_html__( "Search %s of only selected taxonomies (%s categories, tags & terms %s)", 'add-search-to-menu' ),
377
+ strtolower( esc_html( $post_types[$post_type]->labels->name ) ),
378
  '<i>',
379
  '</i>'
380
  ) . '</label></p>' ;
389
  $html = '<div class="col-wrapper is-metas">';
390
  $selected_meta = false;
391
  $html .= '<input class="list-search wide" placeholder="' . __( "Search..", 'add-search-to-menu' ) . '" type="text">';
392
+ $html .= '<select class="_is_includes-custom_field" name="' . esc_attr( $id ) . '[custom_field][]" multiple size="8" >';
393
  foreach ( $meta_keys as $meta_key ) {
394
  $checked = ( isset( $includes['custom_field'] ) && in_array( $meta_key, $includes['custom_field'] ) ? $meta_key : 0 );
395
  if ( $checked ) {
398
  $html .= '<option value="' . esc_attr( $meta_key ) . '" ' . selected( $meta_key, $checked, false ) . '>' . esc_html( $meta_key ) . '</option>';
399
  }
400
  $html .= '</select>';
401
+ $html .= '<br /><label for="' . esc_attr( $id ) . '-custom_field" class="ctrl-multi-select">' . esc_html__( "Hold down the control (ctrl) or command button to select multiple options.", 'add-search-to-menu' ) . '</label><br />';
402
  $html .= '</div>';
403
  $checked = ( $selected_meta ? 'selected' : 'all' );
404
+ echo '<br /><p class="check-radio"><label for="' . esc_attr( $post_type ) . '-meta-search_selected" ><input class="is-meta-select" type="checkbox" id="' . esc_attr( $post_type ) . '-meta-search_selected" name="' . esc_attr( $post_type ) . 'i[meta_search_radio]" value="selected" ' . checked( 'selected', $checked, false ) . '/>' ;
405
  echo '<span class="toggle-check-text"></span>' . sprintf( esc_html__( "Search selected %s custom fields values", 'add-search-to-menu' ), $post_type ) . '</label></p>' ;
406
  echo $html ;
407
  }
414
  if ( '' !== $woo_sku_disable ) {
415
  echo '<div class="upgrade-parent">' ;
416
  }
417
+ echo '<p class="check-radio"><label for="' . esc_attr( $id ) . '-sku" ><input class="_is_includes-woocommerce" type="checkbox" ' . $woo_sku_disable . ' id="' . esc_attr( $id ) . '-sku" name="' . esc_attr( $id ) . '[woo][sku]" value="1" ' . checked( 1, $checked, false ) . '/>' ;
418
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Search product SKU", 'add-search-to-menu' ) . '</label></p>' ;
419
  $checked = ( isset( $includes['woo']['variation'] ) && $includes['woo']['variation'] ? 1 : 0 );
420
+ echo '<p class="check-radio"><label for="' . esc_attr( $id ) . '-variation" ><input class="_is_includes-woocommerce" type="checkbox" ' . $woo_sku_disable . ' id="' . esc_attr( $id ) . '-variation" name="' . esc_attr( $id ) . '[woo][variation]" value="1" ' . checked( 1, $checked, false ) . '/>' ;
421
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Search product variation", 'add-search-to-menu' ) . '</label>' ;
422
  echo IS_Admin::pro_link( 'pro_plus' ) ;
423
  if ( '' !== $woo_sku_disable ) {
444
  ksort( $file_types );
445
  $html = '<br /><div class="is-mime">';
446
  $html .= '<input class="list-search wide" placeholder="' . __( "Search..", 'add-search-to-menu' ) . '" type="text">';
447
+ $html .= '<select class="_is_includes-post_file_type" name="' . esc_attr( $id ) . '[post_file_type][]" ' . $file_type_disable . ' multiple size="8" >';
448
  foreach ( $file_types as $key => $file_type ) {
449
  $checked = ( isset( $includes['post_file_type'] ) && in_array( $file_type, $includes['post_file_type'] ) ? $file_type : 0 );
450
  $html .= '<option value="' . esc_attr( $file_type ) . '" ' . selected( $file_type, $checked, false ) . '>' . esc_html( $key ) . '</option>';
451
  }
452
  $html .= '</select>';
453
  echo IS_Admin::pro_link( 'pro_plus' ) ;
454
+ $html .= '<br /><label for="' . esc_attr( $id ) . '-post_file_type" class="ctrl-multi-select">' . esc_html__( "Hold down the control (ctrl) or command button to select multiple options.", 'add-search-to-menu' ) . '</label><br />';
455
 
456
  if ( isset( $includes['post_file_type'] ) ) {
457
  $html .= __( 'Selected File Types :', 'add-search-to-menu' );
468
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Search only selected MIME types", 'add-search-to-menu' ) . '</label></p>' ;
469
  echo $html ;
470
  echo '<span class="search-attachments-wrapper">' ;
471
+ echo '<p class="check-radio"><label for="' . esc_attr( $id ) . '-search_images"><input class="search-attachments" type="checkbox" id="' . esc_attr( $id ) . '-search_images" name="search_images" value="1" checked="checked" />' ;
472
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Search Images", 'add-search-to-menu' ) . '</label></p>' ;
473
+ echo '<p class="check-radio"><label for="' . esc_attr( $id ) . '-search_videos"><input class="search-attachments" type="checkbox" id="' . esc_attr( $id ) . '-search_videos" name="search_videos" value="1" checked="checked" />' ;
474
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Search Videos", 'add-search-to-menu' ) . '</label></p>' ;
475
+ echo '<p class="check-radio"><label for="' . esc_attr( $id ) . '-search_audios"><input class="search-attachments" type="checkbox" id="' . esc_attr( $id ) . '-search_audios" name="search_audios" value="1" checked="checked" />' ;
476
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Search Audios", 'add-search-to-menu' ) . '</label></p>' ;
477
+ echo '<p class="check-radio"><label for="' . esc_attr( $id ) . '-search_text"><input class="search-attachments" type="checkbox" id="' . esc_attr( $id ) . '-search_text" name="search_text" value="1" checked="checked" />' ;
478
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Search Text Files", 'add-search-to-menu' ) . '</label></p>' ;
479
+ echo '<p class="check-radio"><label for="' . esc_attr( $id ) . '-search_pdfs"><input class="search-attachments" type="checkbox" id="' . esc_attr( $id ) . '-search_pdfs" name="search_pdfs" value="1" checked="checked" />' ;
480
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Search PDF Files", 'add-search-to-menu' ) . '</label></p>' ;
481
+ echo '<p class="check-radio"><label for="' . esc_attr( $id ) . '-search_docs"><input class="search-attachments" type="checkbox" id="' . esc_attr( $id ) . '-search_docs" name="search_docs" value="1" checked="checked"/>' ;
482
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Search Document Files", 'add-search-to-menu' ) . '</label></p>' ;
483
  echo '</span>' ;
484
  if ( '' !== $file_type_disable ) {
504
 
505
  <h3 scope="row">
506
  <label for="<?php
507
+ echo esc_attr( $id ) ;
508
  ?>-extras"><?php
509
  echo esc_html( __( 'Extras', 'add-search-to-menu' ) ) ;
510
  ?></label>
517
  <div><div class="includes_extras">
518
  <h4 scope="row" class="is-first-title">
519
  <label for="<?php
520
+ echo esc_attr( $id ) ;
521
  ?>-search_content"><?php
522
  echo esc_html( __( 'Search Content', 'add-search-to-menu' ) ) ;
523
  ?></label>
524
  </h4>
525
  <?php
526
  $checked = ( $default_search || isset( $includes['search_title'] ) && $includes['search_title'] ? 1 : 0 );
527
+ echo '<p class="check-radio"><label for="' . esc_attr( $id ) . '-search_title"><input class="_is_includes-post_type" type="checkbox" id="' . esc_attr( $id ) . '-search_title" name="' . esc_attr( $id ) . '[search_title]" value="1" ' . checked( 1, $checked, false ) . '/>' ;
528
  echo '<span class="toggle-check-text"></span>' . sprintf( esc_html__( "Search post title %s( File title )%s", 'add-search-to-menu' ), '<i>', '</i>' ) . '</label></p>' ;
529
  $checked = ( $default_search || isset( $includes['search_content'] ) && $includes['search_content'] ? 1 : 0 );
530
+ echo '<p class="check-radio"><label for="' . esc_attr( $id ) . '-search_content"><input class="_is_includes-post_type" type="checkbox" id="' . esc_attr( $id ) . '-search_content" name="' . esc_attr( $id ) . '[search_content]" value="1" ' . checked( 1, $checked, false ) . '/>' ;
531
  echo '<span class="toggle-check-text"></span>' . sprintf( esc_html__( "Search post content %s( File description )%s", 'add-search-to-menu' ), '<i>', '</i>' ) . '</label></p>' ;
532
  $checked = ( $default_search || isset( $includes['search_excerpt'] ) && $includes['search_excerpt'] ? 1 : 0 );
533
+ echo '<p class="check-radio"><label for="' . esc_attr( $id ) . '-search_excerpt"><input class="_is_includes-post_type" type="checkbox" id="' . esc_attr( $id ) . '-search_excerpt" name="' . esc_attr( $id ) . '[search_excerpt]" value="1" ' . checked( 1, $checked, false ) . '/>' ;
534
  echo '<span class="toggle-check-text"></span>' . sprintf( esc_html__( "Search post excerpt %s( File caption )%s", 'add-search-to-menu' ), '<i>', '</i>' ) . '</label></p>' ;
535
  $checked = ( isset( $includes['search_tax_title'] ) && $includes['search_tax_title'] ? 1 : 0 );
536
+ echo '<p class="check-radio"><label for="' . esc_attr( $id ) . '-search_tax_title" ><input class="_is_includes-tax_query" type="checkbox" id="' . esc_attr( $id ) . '-search_tax_title" name="' . esc_attr( $id ) . '[search_tax_title]" value="1" ' . checked( 1, $checked, false ) . '/>' ;
537
  echo '<span class="toggle-check-text"></span>' . sprintf( esc_html__( "Search category/tag title %s( Displays posts of the category/tag )%s", 'add-search-to-menu' ), '<i>', '</i>' ) . '</label></p>' ;
538
  $checked = ( isset( $includes['search_tax_desp'] ) && $includes['search_tax_desp'] ? 1 : 0 );
539
+ echo '<p class="check-radio"><label for="' . esc_attr( $id ) . '-search_tax_desp" ><input class="_is_includes-tax_query" type="checkbox" id="' . esc_attr( $id ) . '-search_tax_desp" name="' . esc_attr( $id ) . '[search_tax_desp]" value="1" ' . checked( 1, $checked, false ) . '/>' ;
540
  echo '<span class="toggle-check-text"></span>' . sprintf( esc_html__( "Search category/tag description %s( Displays posts of the category/tag )%s", 'add-search-to-menu' ), '<i>', '</i>' ) . '</label></p>' ;
541
 
542
  if ( isset( $includes['tax_query'] ) ) {
567
  }
568
 
569
  $checked = ( isset( $includes['tax_rel'] ) && "AND" == $includes['tax_rel'] ? "AND" : "OR" );
570
+ echo '<label for="' . esc_attr( $id ) . '-tax_rel_and" ><input class="_is_includes-tax_query" type="radio" id="' . esc_attr( $id ) . '-tax_rel_and" ' . $tax_rel_disable . ' name="' . esc_attr( $id ) . '[tax_rel]" value="AND" ' . checked( 'AND', $checked, false ) . '/>' ;
571
  echo '<span class="toggle-check-text"></span>' . esc_html__( "AND - Search posts having all the above selected category terms", 'add-search-to-menu' ) . '</label></p>' ;
572
+ echo '<p class="check-radio"><label for="' . esc_attr( $id ) . '-tax_rel_or" ><input class="_is_includes-tax_query" type="radio" id="' . esc_attr( $id ) . '-tax_rel_or" ' . $tax_rel_disable . ' name="' . esc_attr( $id ) . '[tax_rel]" value="OR" ' . checked( 'OR', $checked, false ) . '/>' ;
573
  echo '<span class="toggle-check-text"></span>' . esc_html__( "OR - Search posts having any one of the above selected category terms", 'add-search-to-menu' ) . '</label></p>' ;
574
  }
575
 
578
 
579
  <h4 scope="row">
580
  <label for="<?php
581
+ echo esc_attr( $id ) ;
582
  ?>-post_status"><?php
583
  echo esc_html( __( 'Post Status', 'add-search-to-menu' ) ) ;
584
  ?></label>
615
  foreach ( $post_statuses as $key => $post_status ) {
616
  $checked = ( isset( $includes['post_status'][esc_attr( $key )] ) ? $includes['post_status'][esc_attr( $key )] : 0 );
617
  $temp = ( 'publish' === $post_status || 'inherit' === $post_status ? '' : $post_status_disable );
618
+ echo '<label for="' . esc_attr( $id ) . '-post_status-' . esc_attr( $key ) . '"><input class="_is_includes-post_status" type="checkbox" ' . $temp . ' id="' . esc_attr( $id ) . '-post_status-' . esc_attr( $key ) . '" name="' . esc_attr( $id ) . '[post_status][' . esc_attr( $key ) . ']" value="' . esc_attr( $key ) . '" ' . checked( $key, $checked, false ) . '/>' ;
619
  echo '<span class="toggle-check-text"></span> ' . ucwords( str_replace( '-', ' ', esc_html( $post_status ) ) ) . '</label>' ;
620
  }
621
  echo '</div></div>' ;
625
  </div></div>
626
  <h4 scope="row">
627
  <label for="<?php
628
+ echo esc_attr( $id ) ;
629
  ?>-author"><?php
630
  echo esc_html( __( 'Authors', 'add-search-to-menu' ) ) ;
631
  ?></label>
673
  continue;
674
  }
675
  $checked = ( isset( $includes['author'][esc_attr( $author->ID )] ) ? $includes['author'][esc_attr( $author->ID )] : 0 );
676
+ echo '<label for="' . esc_attr( $id ) . '-author-' . esc_attr( $author->ID ) . '"><input class="_is_includes-author" type="checkbox" ' . $author_disable . ' id="' . esc_attr( $id ) . '-author-' . esc_attr( $author->ID ) . '" name="' . esc_attr( $id ) . '[author][' . esc_attr( $author->ID ) . ']" value="' . esc_attr( $author->ID ) . '" ' . checked( $author->ID, $checked, false ) . '/>' ;
677
  echo '<span class="toggle-check-text"></span> ' . ucfirst( esc_html( $author->display_name ) ) . '</label>' ;
678
  }
679
  echo '</div></div>' ;
687
  echo '</div>' ;
688
  }
689
  $checked = ( isset( $includes['search_author'] ) && $includes['search_author'] ? 1 : 0 );
690
+ echo '<p class="check-radio"><label for="' . esc_attr( $id ) . '-search_author" ><input class="_is_includes-author" type="checkbox" id="' . esc_attr( $id ) . '-search_author" name="' . esc_attr( $id ) . '[search_author]" value="1" ' . checked( 1, $checked, false ) . '/>' ;
691
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Search author Display Name and display the posts created by that author", 'add-search-to-menu' ) . '</label></p>' ;
692
  ?>
693
  </div></div>
694
 
695
  <h4 scope="row">
696
  <label for="<?php
697
+ echo esc_attr( $id ) ;
698
  ?>-comment_count"><?php
699
  echo esc_html( __( 'Comments', 'add-search-to-menu' ) ) ;
700
  ?></label>
706
  if ( '' !== $comment_count_disable ) {
707
  echo '<div class="upgrade-parent">' . IS_Admin::pro_link() ;
708
  }
709
+ echo '<label for="' . esc_attr( $id ) . '-comment_count-compare"> ' . esc_html( __( 'Search posts having number of comments', 'add-search-to-menu' ) ) . '</label><select class="_is_includes-comment_count" name="' . esc_attr( $id ) . '[comment_count][compare]" ' . esc_attr( $comment_count_disable ) . ' style="min-width: 50px;">' ;
710
  $checked = ( isset( $includes['comment_count']['compare'] ) ? htmlspecialchars_decode( $includes['comment_count']['compare'] ) : '=' );
711
  $compare = array(
712
  '=',
717
  '<='
718
  );
719
  foreach ( $compare as $d ) {
720
+ echo '<option value="' . esc_attr( htmlspecialchars_decode( $d ) ) . '" ' . selected( $d, $checked, false ) . '>' . esc_html( $d ) . '</option>' ;
721
  }
722
  echo '</select>' ;
723
+ echo '<select class="_is_includes-comment_count" name="' . esc_attr( $id ) . '[comment_count][value]" ' . esc_attr( $comment_count_disable ) . ' >' ;
724
  $checked = ( isset( $includes['comment_count']['value'] ) ? $includes['comment_count']['value'] : 'na' );
725
  echo '<option value="na" ' . selected( 'na', $checked, false ) . '>' . esc_html( __( 'NA', 'add-search-to-menu' ) ) . '</option>' ;
726
  for ( $d = 0 ; $d <= 999 ; $d++ ) {
727
+ echo '<option value="' . esc_attr( $d ) . '" ' . selected( $d, $checked, false ) . '>' . esc_html( $d ) . '</option>' ;
728
  }
729
  echo '</select>' ;
730
  if ( '' !== $comment_count_disable ) {
731
  echo '</div>' ;
732
  }
733
  $checked = ( isset( $includes['search_comment'] ) && $includes['search_comment'] ? 1 : 0 );
734
+ echo '<p class="check-radio"><label for="' . esc_attr( $id ) . '-search_comment" ><input class="_is_includes-comment_count" type="checkbox" id="' . esc_attr( $id ) . '-search_comment" name="' . esc_attr( $id ) . '[search_comment]" value="1" ' . checked( 1, $checked, false ) . '/>' ;
735
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Search approved comment content", 'add-search-to-menu' ) . '</label></p>' ;
736
  ?>
737
  </div></div>
738
 
739
  <h4 scope="row">
740
  <label for="<?php
741
+ echo esc_attr( $id ) ;
742
  ?>-has_password"><?php
743
  echo esc_html( __( 'Password Protected', 'add-search-to-menu' ) ) ;
744
  ?></label>
746
  <div><div>
747
  <?php
748
  $checked = ( isset( $includes['has_password'] ) ? $includes['has_password'] : 'null' );
749
+ echo '<p class="check-radio"><label for="' . esc_attr( $id ) . '-has_password" ><input class="_is_includes-has_password" type="radio" id="' . esc_attr( $id ) . '-has_password" name="' . esc_attr( $id ) . '[has_password]" value="null" ' . checked( 'null', $checked, false ) . '/>' ;
750
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Search posts with or without passwords", 'add-search-to-menu' ) . '</label></p>' ;
751
+ echo '<p class="check-radio"><label for="' . esc_attr( $id ) . '-has_password_1" ><input class="_is_includes-has_password" type="radio" id="' . esc_attr( $id ) . '-has_password_1" name="' . esc_attr( $id ) . '[has_password]" value="1" ' . checked( 1, $checked, false ) . '/>' ;
752
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Search posts with passwords", 'add-search-to-menu' ) . '</label></p>' ;
753
+ echo '<p class="check-radio"><label for="' . esc_attr( $id ) . '-has_password_0" ><input class="_is_includes-has_password" type="radio" id="' . esc_attr( $id ) . '-has_password_0" name="' . esc_attr( $id ) . '[has_password]" value="0" ' . checked( 0, $checked, false ) . '/>' ;
754
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Search posts without passwords", 'add-search-to-menu' ) . '</label></p>' ;
755
  ?>
756
  </div></div>
757
  <h4 scope="row">
758
  <label for="<?php
759
+ echo esc_attr( $id ) ;
760
  ?>-date_query"><?php
761
  echo esc_html( __( 'Date', 'add-search-to-menu' ) ) ;
762
  ?></label>
769
  $range = array( 'after', 'before' );
770
  foreach ( $range as $value ) {
771
  $col_title = ( 'after' == $value ? __( 'From', 'add-search-to-menu' ) : __( 'To', 'add-search-to-menu' ) );
772
+ echo '<div class="col-wrapper ' . esc_attr( $value ) . '"><div class="col-title">' . esc_html( $col_title ) . '</div>' ;
773
  $checked = ( isset( $includes['date_query'][$value]['date'] ) ? $includes['date_query'][$value]['date'] : '' );
774
+ echo '<input type="text" id="is-' . esc_attr( $value ) . '-datepicker" name="' . esc_attr( $id ) . '[date_query][' . esc_attr( $value ) . '][date]" value="' . esc_attr( $checked ) . '">' ;
775
  echo '</div>' ;
776
  }
777
  ?>
863
  <div>
864
  <?php
865
 
866
+ if ( isset( $_GET['post'] ) && is_numeric( $_GET['post'] ) ) {
867
+ $customizer_url = admin_url( 'customize.php?autofocus[section]=is_section_' . sanitize_key( $_GET['post'] ) );
868
  if ( !$enable_customize ) {
869
  $customizer_url = "//" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
870
  }
1804
  ?>
1805
  </h4>
1806
  <div class="search-form-editor-box" id="<?php
1807
+ echo esc_attr( $id ) ;
1808
  ?>">
1809
  <div class="form-table form-table-panel-excludes">
1810
 
1834
  ?>
1835
  <h3 scope="row">
1836
  <label for="<?php
1837
+ echo esc_attr( $id ) ;
1838
  ?>-post__not_in"><?php
1839
+ echo wp_kses( $accord_title, array(
1840
+ 'i' => array(),
1841
+ ) ) ;
1842
  ?></label>
1843
  <?php
1844
 
1899
  $col_title = '<strong>' . $col_title . '</strong>';
1900
  }
1901
  $html .= $col_title . '<input class="list-search" placeholder="' . __( "Search..", 'add-search-to-menu' ) . '" type="text"></div>';
1902
+ $html .= '<select class="_is_excludes-post__not_in" name="' . esc_attr( $id ) . '[post__not_in][]" multiple size="8" >';
1903
  $html .= $temp . '</select>';
1904
  if ( count( $posts ) >= 100 && !defined( 'DISABLE_IS_LOAD_ALL' ) && !isset( $excludes['post__not_in'] ) ) {
1905
+ $html .= '<div id="' . esc_attr( $post_type ) . '" class="load-all">' . __( 'Load All', 'add-search-to-menu' ) . '</div>';
1906
  }
1907
  $html .= '</div>';
1908
  }
1911
  if ( !$posts_found ) {
1912
  $html .= '<br /><span class="notice-is-info">' . sprintf( __( 'No %s created.', 'add-search-to-menu' ), $post_types2[$post_type]->labels->name ) . '</span>';
1913
  } else {
1914
+ $html .= '<br /><label for="' . esc_attr( $id ) . '-post__not_in" class="ctrl-multi-select">' . esc_html__( "Hold down the control (ctrl) or command button to select multiple options.", 'add-search-to-menu' ) . '</label><br />';
1915
  }
1916
 
1917
  $html .= '</div>';
1928
  continue;
1929
  }
1930
 
1931
+ echo '<p class="check-radio"><label for="' . esc_attr( $post_type ) . '-post-search_all" ><input class="is-post-select" type="radio" id="' . esc_attr( $post_type ) . '-post-search_all" name="' . esc_attr( $post_type ) . 'i[post_search_radio]" value="all" ' . checked( 'all', $checked, false ) . '/>' ;
1932
  echo '<span class="toggle-check-text"></span>' . sprintf( esc_html__( "Do not exclude any %s from search", 'add-search-to-menu' ), strtolower( $post_types2[$post_type]->labels->singular_name ) ) . '</label></p>' ;
1933
+ echo '<p class="check-radio"><label for="' . esc_attr( $post_type ) . '-post-search_selected" ><input class="is-post-select" type="radio" id="' . esc_attr( $post_type ) . '-post-search_selected" name="' . esc_attr( $post_type ) . 'i[post_search_radio]" value="selected" ' . checked( 'selected', $checked, false ) . '/>' ;
1934
  echo '<span class="toggle-check-text"></span>' . sprintf( esc_html__( "Exclude selected %s from search", 'add-search-to-menu' ), strtolower( $post_types2[$post_type]->labels->name ) ) . '</label></p>' ;
1935
  echo $html ;
1936
  } else {
1959
  $selected_tax = true;
1960
  }
1961
 
1962
+ $html .= $col_title . '<input class="list-search" placeholder="' . __( "Search..", 'add-search-to-menu' ) . '" type="text"></div><select class="_is_excludes-tax_query" name="' . esc_attr( $id ) . '[tax_query][' . $key . '][]" multiple size="8" >';
1963
  foreach ( $terms as $key2 => $term ) {
1964
  $checked = ( isset( $excludes['tax_query'][$key] ) && in_array( $term->term_taxonomy_id, $excludes['tax_query'][$key] ) ? $term->term_taxonomy_id : 0 );
1965
  $html .= '<option value="' . esc_attr( $term->term_taxonomy_id ) . '" ' . selected( $term->term_taxonomy_id, $checked, false ) . '>' . esc_html( $term->name ) . '</option>';
1968
  }
1969
 
1970
  }
1971
+ $html .= '<br /><label for="' . esc_attr( $id ) . '-tax_query" class="ctrl-multi-select">' . esc_html__( "Hold down the control (ctrl) or command button to select multiple options.", 'add-search-to-menu' ) . '</label><br />';
1972
  $html .= '</div>';
1973
  $checked = ( $selected_tax ? 'selected' : 'all' );
1974
+ echo '<br /><p class="check-radio"><label for="' . esc_attr( $post_type ) . '-tax-search_all" ><input class="is-tax-select" type="radio" id="' . esc_attr( $post_type ) . '-tax-search_all" name="' . esc_attr( $post_type ) . 'i[tax_search_radio]" value="all" ' . checked( 'all', $checked, false ) . '/>' ;
1975
  echo '<span class="toggle-check-text"></span>' . sprintf(
1976
  esc_html__( "Do not exclude any %s from search of any taxonomies (%s categories, tags & terms %s)", 'add-search-to-menu' ),
1977
  strtolower( $post_types2[$post_type]->labels->singular_name ),
1978
  '<i>',
1979
  '</i>'
1980
  ) . '</label></p>' ;
1981
+ echo '<p class="check-radio"><label for="' . esc_attr( $post_type ) . '-tax-search_selected" ><input class="is-tax-select" type="radio" id="' . esc_attr( $post_type ) . '-tax-search_selected" name="' . esc_attr( $post_type ) . 'i[tax_search_radio]" value="selected" ' . checked( 'selected', $checked, false ) . '/>' ;
1982
  echo '<span class="toggle-check-text"></span>' . sprintf(
1983
  esc_html__( "Exclude %s from search of selected taxonomies (%s categories, tags & terms %s)", 'add-search-to-menu' ),
1984
  strtolower( $post_types2[$post_type]->labels->name ),
1995
  $selected_meta = false;
1996
  $custom_field_disable = ( is_fs()->is_plan_or_trial( 'pro' ) && $this->is_premium_plugin ? '' : ' disabled ' );
1997
  $html .= '<input class="list-search wide" placeholder="' . __( "Search..", 'add-search-to-menu' ) . '" type="text">';
1998
+ $html .= '<select class="_is_excludes-custom_field" name="' . esc_attr( $id ) . '[custom_field][]" ' . $custom_field_disable . ' multiple size="8" >';
1999
  foreach ( $meta_keys as $meta_key ) {
2000
  $checked = ( isset( $excludes['custom_field'] ) && in_array( $meta_key, $excludes['custom_field'] ) ? $meta_key : 0 );
2001
  if ( $checked ) {
2005
  }
2006
  $html .= '</select>';
2007
  $html .= IS_Admin::pro_link();
2008
+ $html .= '<br /><label for="' . esc_attr( $id ) . '-custom_field" class="ctrl-multi-select">' . esc_html__( "Hold down the control (ctrl) or command button to select multiple options.", 'add-search-to-menu' ) . '</label><br />';
2009
  $html .= '</div>';
2010
  $checked = ( $selected_meta ? 'selected' : 'all' );
2011
+ echo '<br /><p class="check-radio"><label for="' . esc_attr( $post_type ) . '-meta-search_selected" ><input class="is-meta-select" type="checkbox" id="' . esc_attr( $post_type ) . '-meta-search_selected" name="' . esc_attr( $post_type ) . 'i[meta_search_radio]" value="selected" ' . checked( 'selected', $checked, false ) . '/>' ;
2012
  echo '<span class="toggle-check-text"></span>' . sprintf( esc_html__( "Exclude %s from search having selected custom fields", 'add-search-to-menu' ), strtolower( $post_types2[$post_type]->labels->name ) ) . '</label></p>' ;
2013
  echo $html ;
2014
  }
2021
  echo '<br /><div class="upgrade-parent">' ;
2022
  }
2023
  $checked = ( isset( $excludes['woo']['outofstock'] ) && $excludes['woo']['outofstock'] ? 1 : 0 );
2024
+ echo '<p class="check-radio"><label for="' . esc_attr( $id ) . '-outofstock" ><input class="_is_excludes-woocommerce" type="checkbox" ' . $outofstock_disable . ' id="' . esc_attr( $id ) . '-outofstock" name="' . esc_attr( $id ) . '[woo][outofstock]" value="1" ' . checked( 1, $checked, false ) . '/>' ;
2025
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Exclude 'Out of Stock' products from search", 'add-search-to-menu' ) . '</label></p>' ;
2026
  echo IS_Admin::pro_link( 'pro_plus' ) ;
2027
  if ( '' !== $outofstock_disable ) {
2047
  ksort( $file_types );
2048
  $html = '<br /><div class="is-mime">';
2049
  $html .= '<input class="list-search wide" placeholder="' . __( "Search..", 'add-search-to-menu' ) . '" type="text">';
2050
+ $html .= '<select class="_is_excludes-post_file_type" name="' . esc_attr( $id ) . '[post_file_type][]" ' . $file_type_disable . ' multiple size="8" >';
2051
  foreach ( $file_types as $key => $file_type ) {
2052
  $checked = ( isset( $excludes['post_file_type'] ) && in_array( $file_type, $excludes['post_file_type'] ) ? $file_type : 0 );
2053
  $html .= '<option value="' . esc_attr( $file_type ) . '" ' . selected( $file_type, $checked, false ) . '>' . esc_html( $key ) . '</option>';
2054
  }
2055
  $html .= '</select>';
2056
  echo IS_Admin::pro_link( 'pro_plus' ) ;
2057
+ $html .= '<br /><label for="' . esc_attr( $id ) . '-post_file_type" class="ctrl-multi-select">' . esc_html__( "Hold down the control (ctrl) or command button to select multiple options.", 'add-search-to-menu' ) . '</label><br />';
2058
 
2059
  if ( isset( $excludes['post_file_type'] ) ) {
2060
  $html .= __( 'Excluded File Types :', 'add-search-to-menu' );
2071
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Exclude selected MIME types from search", 'add-search-to-menu' ) . '</label></p>' ;
2072
  echo $html ;
2073
  echo '<span class="search-attachments-wrapper">' ;
2074
+ echo '<p class="check-radio"><label for="' . esc_attr( $id ) . '-search_images"><input class="search-attachments exclude" type="checkbox" id="' . esc_attr( $id ) . '-search_images" name="search_images" value="1" />' ;
2075
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Exclude Images", 'add-search-to-menu' ) . '</label></p>' ;
2076
+ echo '<p class="check-radio"><label for="' . esc_attr( $id ) . '-search_videos"><input class="search-attachments exclude" type="checkbox" id="' . esc_attr( $id ) . '-search_videos" name="search_videos" value="1" />' ;
2077
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Exclude Videos", 'add-search-to-menu' ) . '</label></p>' ;
2078
+ echo '<p class="check-radio"><label for="' . esc_attr( $id ) . '-search_audios"><input class="search-attachments exclude" type="checkbox" id="' . esc_attr( $id ) . '-search_audios" name="search_audios" value="1" />' ;
2079
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Exclude Audios", 'add-search-to-menu' ) . '</label></p>' ;
2080
+ echo '<p class="check-radio"><label for="' . esc_attr( $id ) . '-search_text"><input class="search-attachments exclude" type="checkbox" id="' . esc_attr( $id ) . '-search_text" name="search_text" value="1" />' ;
2081
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Exclude Text Files", 'add-search-to-menu' ) . '</label></p>' ;
2082
+ echo '<p class="check-radio"><label for="' . esc_attr( $id ) . '-search_pdfs"><input class="search-attachments exclude" type="checkbox" id="' . esc_attr( $id ) . '-search_pdfs" name="search_pdfs" value="1" />' ;
2083
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Exclude PDF Files", 'add-search-to-menu' ) . '</label></p>' ;
2084
+ echo '<p class="check-radio"><label for="' . esc_attr( $id ) . '-search_docs"><input class="search-attachments exclude" type="checkbox" id="' . esc_attr( $id ) . '-search_docs" name="search_docs" value="1" />' ;
2085
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Exclude Document Files", 'add-search-to-menu' ) . '</label></p>' ;
2086
  echo '</span>' ;
2087
  if ( '' !== $file_type_disable ) {
2107
  ?>
2108
  <h3 scope="row">
2109
  <label for="<?php
2110
+ echo esc_attr( $id ) ;
2111
  ?>-extras"><?php
2112
  echo esc_html( __( 'Extras', 'add-search-to-menu' ) ) ;
2113
  ?></label>
2120
  <div>
2121
  <h4 scope="row" class="is-first-title">
2122
  <label for="<?php
2123
+ echo esc_attr( $id ) ;
2124
  ?>-author"><?php
2125
  echo esc_html( __( 'Authors', 'add-search-to-menu' ) ) ;
2126
  ?></label>
2169
  continue;
2170
  }
2171
  $checked = ( isset( $excludes['author'][esc_attr( $author->ID )] ) ? $excludes['author'][esc_attr( $author->ID )] : 0 );
2172
+ echo '<label for="' . esc_attr( $id ) . '-author-' . esc_attr( $author->ID ) . '"><input class="_is_excludes-author" type="checkbox" ' . $author_disable . ' id="' . esc_attr( $id ) . '-author-' . esc_attr( $author->ID ) . '" name="' . esc_attr( $id ) . '[author][' . esc_attr( $author->ID ) . ']" value="' . esc_attr( $author->ID ) . '" ' . checked( $author->ID, $checked, false ) . '/>' ;
2173
  echo '<span class="toggle-check-text"></span> ' . ucfirst( esc_html( $author->display_name ) ) . '</label>' ;
2174
  }
2175
  echo '</div></div>' ;
2184
 
2185
  <h4 scope="row">
2186
  <label for="<?php
2187
+ echo esc_attr( $id ) ;
2188
  ?>-post_status"><?php
2189
  echo esc_html( __( 'Post Status', 'add-search-to-menu' ) ) ;
2190
  ?></label>
2195
  IS_Help::help_info( $content );
2196
  echo '<div>' ;
2197
  $checked = ( isset( $excludes['ignore_sticky_posts'] ) && $excludes['ignore_sticky_posts'] ? 1 : 0 );
2198
+ echo '<label for="' . esc_attr( $id ) . '-ignore_sticky_posts" ><input class="_is_excludes-post_status" type="checkbox" id="' . esc_attr( $id ) . '-ignore_sticky_posts" name="' . esc_attr( $id ) . '[ignore_sticky_posts]" value="1" ' . checked( 1, $checked, false ) . '/>' ;
2199
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Exclude sticky posts from search", 'add-search-to-menu' ) . '</label>' ;
2200
  ?>
2201
  </div></div>
2216
  ?>
2217
  </h4>
2218
  <div class="search-form-editor-box" id="<?php
2219
+ echo esc_attr( $id ) ;
2220
  ?>">
2221
  <div class="form-table form-table-panel-options">
2222
 
2223
  <h3 scope="row">
2224
  <label for="<?php
2225
+ echo esc_attr( $id ) ;
2226
  ?>-posts_per_page"><?php
2227
  echo esc_html( __( 'Posts Per Page', 'add-search-to-menu' ) ) ;
2228
  ?></label>
2236
  $content = __( 'Display selected number of posts in search results.', 'add-search-to-menu' );
2237
  IS_Help::help_info( $content );
2238
  echo '<div>' ;
2239
+ echo '<select class="_is_settings-posts_per_page" name="' . esc_attr( $id ) . '[posts_per_page]" >' ;
2240
  $default_per_page = get_option( 'posts_per_page', 10 );
2241
  $checked = ( isset( $settings['posts_per_page'] ) ? $settings['posts_per_page'] : $default_per_page );
2242
  for ( $d = 1 ; $d <= 1000 ; $d++ ) {
2251
 
2252
  <h3 scope="row">
2253
  <label for="<?php
2254
+ echo esc_attr( $id ) ;
2255
  ?>-order"><?php
2256
  echo esc_html( __( 'Order Search Results', 'add-search-to-menu' ) ) ;
2257
  ?></label>
2261
  IS_Help::help_info( $content );
2262
  echo '<div>' ;
2263
  $orderby_disable = ( is_fs()->is_plan_or_trial( 'pro' ) && $this->is_premium_plugin ? '' : ' disabled ' );
2264
+ echo '<select class="_is_settings-order" name="' . esc_attr( $id ) . '[orderby]" ' . $orderby_disable . ' >' ;
2265
  $checked = ( isset( $settings['orderby'] ) ? $settings['orderby'] : 'date' );
2266
  $orderbys = array(
2267
  'date',
2286
  foreach ( $orderbys as $orderby ) {
2287
  echo '<option value="' . $orderby . '" ' . selected( $orderby, $checked, false ) . '>' . ucwords( str_replace( '_', ' ', esc_html( $orderby ) ) ) . '</option>' ;
2288
  }
2289
+ echo '</select><select class="_is_settings-order" name="' . esc_attr( $id ) . '[order]" ' . $orderby_disable . ' >' ;
2290
  $checked = ( isset( $settings['order'] ) ? $settings['order'] : 'DESC' );
2291
  $orders = array( 'DESC', 'ASC' );
2292
  foreach ( $orders as $order ) {
2300
 
2301
  <h3 scope="row">
2302
  <label for="<?php
2303
+ echo esc_attr( $id ) ;
2304
  ?>-highlight_terms"><?php
2305
  echo esc_html( __( 'Highlight Search Terms', 'add-search-to-menu' ) ) ;
2306
  ?></label>
2308
  <div><div>
2309
  <?php
2310
  $checked = ( isset( $settings['highlight_terms'] ) && $settings['highlight_terms'] ? 1 : 0 );
2311
+ echo '<p class="check-radio"><label for="' . esc_attr( $id ) . '-highlight_terms" ><input class="_is_settings-highlight_terms" type="checkbox" id="' . esc_attr( $id ) . '-highlight_terms" name="' . esc_attr( $id ) . '[highlight_terms]" value="1" ' . checked( 1, $checked, false ) . '/>' ;
2312
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Highlight searched terms on search results page", 'add-search-to-menu' ) . '</label></p>' ;
2313
  $color = ( isset( $settings['highlight_color'] ) ? $settings['highlight_color'] : '#FFFFB9' );
2314
+ echo '<div class="highlight-container"><br /><input style="width: 80px;" class="_is_settings-highlight_terms is-colorpicker" size="5" type="text" id="' . esc_attr( $id ) . '-highlight_color" name="' . esc_attr( $id ) . '[highlight_color]" value="' . $color . '" />' ;
2315
  echo '<br /><i> ' . esc_html__( "Select text highlight color", 'add-search-to-menu' ) . '</i></div>' ;
2316
  ?>
2317
  </div></div>
2319
 
2320
  <h3 scope="row">
2321
  <label for="<?php
2322
+ echo esc_attr( $id ) ;
2323
  ?>-term_rel"><?php
2324
  echo esc_html( __( 'Search All Or Any Search Terms', 'add-search-to-menu' ) ) ;
2325
  ?></label>
2330
  IS_Help::help_info( $content );
2331
  echo '<div>' ;
2332
  $checked = ( isset( $settings['term_rel'] ) && "OR" === $settings['term_rel'] ? "OR" : "AND" );
2333
+ echo '<p class="check-radio"><label for="' . esc_attr( $id ) . '-term_rel_or" ><input class="_is_settings-term_rel" type="radio" id="' . esc_attr( $id ) . '-term_rel_or" name="' . esc_attr( $id ) . '[term_rel]" value="OR" ' . checked( 'OR', $checked, false ) . '/>' ;
2334
  echo '<span class="toggle-check-text"></span>' . esc_html__( "OR - Display content having any of the search terms", 'add-search-to-menu' ) . '</label></p>' ;
2335
+ echo '<p class="check-radio"><label for="' . esc_attr( $id ) . '-term_rel_and" ><input class="_is_settings-term_rel" type="radio" id="' . esc_attr( $id ) . '-term_rel_and" name="' . esc_attr( $id ) . '[term_rel]" value="AND" ' . checked( 'AND', $checked, false ) . '/>' ;
2336
  echo '<span class="toggle-check-text"></span>' . esc_html__( "AND - Display content having all the search terms", 'add-search-to-menu' ) . '</label></p>' ;
2337
  ?>
2338
  </div></div>
2340
 
2341
  <h3 scope="row">
2342
  <label for="<?php
2343
+ echo esc_attr( $id ) ;
2344
  ?>-fuzzy_match"><?php
2345
  echo esc_html( __( 'Fuzzy Matching', 'add-search-to-menu' ) ) ;
2346
  ?></label>
2350
  IS_Help::help_info( $content );
2351
  echo '<div>' ;
2352
  $checked = ( isset( $settings['fuzzy_match'] ) ? $settings['fuzzy_match'] : '2' );
2353
+ echo '<p class="check-radio"><label for="' . esc_attr( $id ) . '-whole" ><input class="_is_settings-fuzzy_match" type="radio" id="' . esc_attr( $id ) . '-whole" name="' . esc_attr( $id ) . '[fuzzy_match]" value="1" ' . checked( '1', $checked, false ) . '/>' ;
2354
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Whole - Search posts that include the whole search term", 'add-search-to-menu' ) . '</label></p>' ;
2355
+ echo '<p class="check-radio"><label for="' . esc_attr( $id ) . '-partial" ><input class="_is_settings-fuzzy_match" type="radio" id="' . esc_attr( $id ) . '-partial" name="' . esc_attr( $id ) . '[fuzzy_match]" value="2" ' . checked( '2', $checked, false ) . '/>' ;
2356
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Partial - Also search words in the posts that begins or ends with the search term", 'add-search-to-menu' ) . '</label></p>' ;
2357
  ?>
2358
  </div></div>
2360
 
2361
  <h3 scope="row">
2362
  <label for="<?php
2363
+ echo esc_attr( $id ) ;
2364
  ?>-keyword_stem"><?php
2365
  echo esc_html( __( 'Keyword Stemming', 'add-search-to-menu' ) ) ;
2366
  ?></label>
2374
  echo '<div>' ;
2375
  $stem_disable = ( is_fs()->is_plan_or_trial( 'pro_plus' ) && $this->is_premium_plugin ? '' : ' disabled ' );
2376
  $checked = ( isset( $settings['keyword_stem'] ) && $settings['keyword_stem'] ? 1 : 0 );
2377
+ echo '<p class="check-radio"><label for="' . esc_attr( $id ) . '-keyword_stem" ><input class="_is_settings-keyword_stem" type="checkbox" id="' . esc_attr( $id ) . '-keyword_stem" ' . $stem_disable . ' name="' . esc_attr( $id ) . '[keyword_stem]" value="1" ' . checked( 1, $checked, false ) . '/>' ;
2378
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Also search base word of searched keyword", 'add-search-to-menu' ) . '</label></p>' ;
2379
  echo IS_Admin::pro_link( 'pro_plus' ) ;
2380
  ?>
2383
 
2384
  <h3 scope="row">
2385
  <label for="<?php
2386
+ echo esc_attr( $id ) ;
2387
  ?>-extras"><?php
2388
  echo esc_html( __( 'Others', 'add-search-to-menu' ) ) ;
2389
  ?></label>
2395
  <div><div>
2396
  <?php
2397
  $checked = ( isset( $settings['move_sticky_posts'] ) && $settings['move_sticky_posts'] ? 1 : 0 );
2398
+ echo '<p class="check-radio"><label for="' . esc_attr( $id ) . '-move_sticky_posts" ><input class="_is_settings-move_sticky_posts" type="checkbox" id="' . esc_attr( $id ) . '-move_sticky_posts" name="' . esc_attr( $id ) . '[move_sticky_posts]" value="1" ' . checked( 1, $checked, false ) . '/>' ;
2399
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Display sticky posts to the start of the search results page", 'add-search-to-menu' ) . '</label></p>' ;
2400
  $checked = ( isset( $settings['demo'] ) && $settings['demo'] ? 1 : 0 );
2401
+ echo '<p class="check-radio"><label for="' . esc_attr( $id ) . '-demo" ><input class="_is_settings-demo" type="checkbox" id="' . esc_attr( $id ) . '-demo" name="' . esc_attr( $id ) . '[demo]" value="1" ' . checked( 1, $checked, false ) . '/>' ;
2402
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Display search form only for site administrator", 'add-search-to-menu' ) . '</label></p>' ;
2403
  $checked = ( isset( $settings['disable'] ) && $settings['disable'] ? 1 : 0 );
2404
+ echo '<p class="check-radio"><label for="' . esc_attr( $id ) . '-disable" ><input class="_is_settings-disable" type="checkbox" id="' . esc_attr( $id ) . '-disable" name="' . esc_attr( $id ) . '[disable]" value="1" ' . checked( 1, $checked, false ) . '/>' ;
2405
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Disable this search form", 'add-search-to-menu' ) . '</label></p>' ;
2406
  echo '<br /><p class="check-radio">' ;
2407
  $content = __( 'Select whether to display an error when user perform search without any search word.', 'add-search-to-menu' );
2408
  IS_Help::help_info( $content );
2409
  $checked = ( isset( $settings['empty_search'] ) && $settings['empty_search'] ? 1 : 0 );
2410
+ echo '<br /><label for="' . esc_attr( $id ) . '-empty_search" ><input class="_is_settings-empty_search" type="checkbox" id="' . esc_attr( $id ) . '-empty_search" name="' . esc_attr( $id ) . '[empty_search]" value="1" ' . checked( 1, $checked, false ) . '/>' ;
2411
  echo '<span class="toggle-check-text"></span>' . esc_html__( "Display an error for empty search query", 'add-search-to-menu' ) . '</label></p>' ;
2412
  ?>
2413
  </div></div>
admin/class-is-help.php CHANGED
@@ -117,7 +117,7 @@ class IS_Help {
117
  public static function help_info( $content ) { ?>
118
  <span class="is-help">
119
  <span class="is-info">
120
- <?php echo $content; ?>
121
  </span>
122
  </span>
123
  <?php
@@ -133,13 +133,13 @@ class IS_Help {
133
 
134
  public static function woocommerce_inactive_field_notice( $echo = true ) {
135
 
136
- $woo_url = '<a href="'.admin_url('plugins.php').'" target="_blank">'.__( "WooCommerce", 'add-search-to-menu' ).'</a>';
137
- $message = sprintf( __( 'Activate %s plugin to use this option.', 'add-search-to-menu' ), $woo_url );
138
 
139
  if( $echo ) {
140
- echo '<span class="notice-is-info"> ' . $message . '</span>';
141
  } else {
142
- return '<span class="notice-is-info">' . $message . '</span>';
143
  }
144
  }
145
  }
117
  public static function help_info( $content ) { ?>
118
  <span class="is-help">
119
  <span class="is-info">
120
+ <?php echo wp_kses_post( $content ); ?>
121
  </span>
122
  </span>
123
  <?php
133
 
134
  public static function woocommerce_inactive_field_notice( $echo = true ) {
135
 
136
+ $woo_url = '<a href="'.admin_url('plugins.php').'" target="_blank">'.__( "WooCommerce", 'add-search-to-menu' ).'</a>';
137
+ $message = '<span class="notice-is-info"> ' . sprintf( __( 'Activate %s plugin to use this option.', 'add-search-to-menu' ), $woo_url ) . '</span>';
138
 
139
  if( $echo ) {
140
+ echo wp_kses_post( $message );
141
  } else {
142
+ return wp_kses_post( $message );
143
  }
144
  }
145
  }
admin/class-is-list-table.php CHANGED
@@ -57,22 +57,26 @@ class IS_List_Table extends WP_List_Table {
57
  'offset' => ( $this->get_pagenum() - 1 ) * $per_page,
58
  );
59
 
60
- if ( ! empty( $_REQUEST['s'] ) ) {
61
- $args['s'] = $_REQUEST['s'];
 
 
 
 
62
  }
63
 
64
- if ( ! empty( $_REQUEST['orderby'] ) ) {
65
- if ( 'title' == $_REQUEST['orderby'] ) {
66
  $args['orderby'] = 'title';
67
- } elseif ( 'date' == $_REQUEST['orderby'] ) {
68
  $args['orderby'] = 'date';
69
  }
70
  }
71
 
72
- if ( ! empty( $_REQUEST['order'] ) ) {
73
- if ( 'asc' == strtolower( $_REQUEST['order'] ) ) {
74
  $args['order'] = 'ASC';
75
- } elseif ( 'desc' == strtolower( $_REQUEST['order'] ) ) {
76
  $args['order'] = 'DESC';
77
  }
78
  }
@@ -84,7 +88,7 @@ class IS_List_Table extends WP_List_Table {
84
 
85
  if ( 1 == $total_items && ! isset( $_GET['s'] ) ) {
86
  if ( isset( $this->items[0] ) && $this->items[0]->id() ) {
87
- $redirect_to = esc_url( menu_page_url( 'ivory-search', false ) ) . '&post='.$this->items[0]->id().'&action=edit';
88
  wp_safe_redirect( $redirect_to );
89
  exit();
90
  }
@@ -134,7 +138,7 @@ class IS_List_Table extends WP_List_Table {
134
  }
135
 
136
  function column_title( $item ) {
137
- $url = admin_url( 'admin.php?page=ivory-search&post=' . absint( $item->id() ) );
138
  $edit_link = add_query_arg( array( 'action' => 'edit' ), $url );
139
 
140
  $output = sprintf(
57
  'offset' => ( $this->get_pagenum() - 1 ) * $per_page,
58
  );
59
 
60
+ $is_search_val = ( ! empty( $_REQUEST['s'] ) ) ? sanitize_text_field( $_REQUEST['s'] ) : false;
61
+ $is_orderby = ( ! empty( $_REQUEST['orderby'] ) ) ? sanitize_text_field( $_REQUEST['orderby'] ) : false;
62
+ $is_order = ( ! empty( $_REQUEST['order'] ) ) ? sanitize_text_field( $_REQUEST['order'] ) : false;
63
+
64
+ if ( $is_search_val ) {
65
+ $args['s'] = $is_search_val;
66
  }
67
 
68
+ if ( $is_orderby ) {
69
+ if ( 'title' == $is_orderby ) {
70
  $args['orderby'] = 'title';
71
+ } elseif ( 'date' == $is_orderby ) {
72
  $args['orderby'] = 'date';
73
  }
74
  }
75
 
76
+ if ( $is_order ) {
77
+ if ( 'asc' == strtolower( $is_order ) ) {
78
  $args['order'] = 'ASC';
79
+ } elseif ( 'desc' == strtolower( $is_order ) ) {
80
  $args['order'] = 'DESC';
81
  }
82
  }
88
 
89
  if ( 1 == $total_items && ! isset( $_GET['s'] ) ) {
90
  if ( isset( $this->items[0] ) && $this->items[0]->id() ) {
91
+ $redirect_to = esc_url( menu_page_url( 'ivory-search', false ) ) . '&post='.esc_url_raw( $this->items[0]->id() ).'&action=edit';
92
  wp_safe_redirect( $redirect_to );
93
  exit();
94
  }
138
  }
139
 
140
  function column_title( $item ) {
141
+ $url = admin_url( 'admin.php?page=ivory-search&post=' . absint( esc_url_raw( $item->id() ) ) );
142
  $edit_link = add_query_arg( array( 'action' => 'edit' ), $url );
143
 
144
  $output = sprintf(
admin/class-is-settings-fields.php CHANGED
@@ -93,13 +93,13 @@ class IS_Settings_Fields
93
  <h3 scope="row"><label for="<?php
94
  esc_attr_e( $field['args']['label_for'] );
95
  ?>"><?php
96
- echo $field['title'] ;
97
  ?></label>
98
  <?php
99
  } else {
100
  ?>
101
  <h3 scope="row"><?php
102
- echo $field['title'] ;
103
  }
104
 
105
 
@@ -228,7 +228,7 @@ class IS_Settings_Fields
228
  'ivory_search',
229
  'ivory_search_settings'
230
  );
231
- register_setting( 'ivory_search', 'is_settings' );
232
  } else {
233
 
234
  if ( 'menu-search' === $tab ) {
@@ -271,6 +271,44 @@ class IS_Settings_Fields
271
 
272
  }
273
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
274
  /**
275
  * Displays Search To Menu section description text.
276
  */
@@ -473,7 +511,7 @@ class IS_Settings_Fields
473
  $color = ( isset( $this->opt['menu_magnifier_color'] ) ? $this->opt['menu_magnifier_color'] : '#848484' );
474
  ?>
475
  <input style="width: 80px;" class="menu-magnifier-color is-colorpicker" size="5" type="text" id="is-menu-magnifier-color" name="is_menu_search[menu_magnifier_color]" value="<?php
476
- echo $color ;
477
  ?>" />
478
  <br /><i> <?php
479
  esc_html_e( 'Select menu magnifier icon color.', 'add-search-to-menu' );
@@ -535,11 +573,11 @@ class IS_Settings_Fields
535
  foreach ( $posts as $post ) {
536
  ?>
537
  <option value="<?php
538
- echo $post->ID ;
539
  ?>" <?php
540
  selected( $post->ID, $check_value, true );
541
  ?>><?php
542
- echo $post->post_title ;
543
  ?></option>
544
  <?php
545
  }
@@ -552,7 +590,7 @@ class IS_Settings_Fields
552
  <a href="<?php
553
  echo esc_url( menu_page_url( 'ivory-search', false ) ) ;
554
  ?>&post=<?php
555
- echo $check_value ;
556
  ?>&action=edit"> <?php
557
  esc_html_e( 'Edit Search Form', 'add-search-to-menu' );
558
  ?></a>
@@ -693,11 +731,11 @@ class IS_Settings_Fields
693
  foreach ( $posts as $post ) {
694
  ?>
695
  <option value="<?php
696
- echo $post->ID ;
697
  ?>" <?php
698
  selected( $post->ID, $check_value, true );
699
  ?>><?php
700
- echo $post->post_title ;
701
  ?></option>
702
  <?php
703
  }
@@ -761,11 +799,11 @@ class IS_Settings_Fields
761
  foreach ( $posts as $post ) {
762
  ?>
763
  <option value="<?php
764
- echo $post->ID ;
765
  ?>" <?php
766
  selected( $post->ID, $check_value, true );
767
  ?>><?php
768
- echo $post->post_title ;
769
  ?></option>
770
  <?php
771
  }
@@ -776,7 +814,7 @@ class IS_Settings_Fields
776
  if ( $check_value && get_post_type( $check_value ) ) {
777
  ?>
778
  <a href="<?php
779
- echo esc_url( menu_page_url( 'ivory-search', false ) ) . '&post=' . $check_value . '&action=edit' ;
780
  ?>"> <?php
781
  esc_html_e( "Edit", 'add-search-to-menu' );
782
  ?></a>
@@ -808,7 +846,7 @@ class IS_Settings_Fields
808
  ?>
809
  <div>
810
  <label for="is_search_in_header"><input class="ivory_search_display_in_header" type="checkbox" id="is_search_in_header" name="is_settings[header_menu_search]" value="header_menu_search" <?php
811
- echo $check_string ;
812
  ?>/>
813
  <span class="toggle-check-text"></span><?php
814
  esc_html_e( 'Display search form in site header on mobile devices', 'add-search-to-menu' );
@@ -822,7 +860,7 @@ class IS_Settings_Fields
822
  ?>
823
  <div>
824
  <label for="is_site_uses_cache"><input class="ivory_search_display_in_header" type="checkbox" id="is_site_uses_cache" name="is_settings[site_uses_cache]" value="site_uses_cache" <?php
825
- echo $check_string ;
826
  ?>/>
827
  <span class="toggle-check-text"></span><?php
828
  esc_html_e( 'This site uses cache', 'add-search-to-menu' );
@@ -928,7 +966,7 @@ class IS_Settings_Fields
928
  ?>]" value="<?php
929
  esc_attr_e( $key );
930
  ?>" <?php
931
- echo $check_string ;
932
  ?>/>
933
  <span class="toggle-check-text"></span><?php
934
  esc_html_e( $file );
93
  <h3 scope="row"><label for="<?php
94
  esc_attr_e( $field['args']['label_for'] );
95
  ?>"><?php
96
+ echo wp_kses_post( $field['title'] ) ;
97
  ?></label>
98
  <?php
99
  } else {
100
  ?>
101
  <h3 scope="row"><?php
102
+ echo wp_kses_post( $field['title'] ) ;
103
  }
104
 
105
 
228
  'ivory_search',
229
  'ivory_search_settings'
230
  );
231
+ register_setting( 'ivory_search', 'is_settings', array( $this, 'is_validate_setting' ) );
232
  } else {
233
 
234
  if ( 'menu-search' === $tab ) {
271
 
272
  }
273
 
274
+ function is_validate_setting( $args )
275
+ {
276
+
277
+ if ( isset( $args['custom_css'] ) && preg_match( '#</?\\w+#', $args['custom_css'] ) ) {
278
+ add_settings_error(
279
+ 'is_settings',
280
+ 'invalid_is_css',
281
+ __( 'Invalid Custom CSS Code', 'add-search-to-menu' ),
282
+ 'error'
283
+ );
284
+ $args['custom_css'] = $this->opt['custom_css'];
285
+ }
286
+
287
+
288
+ if ( isset( $args['custom_css'] ) && preg_match( '#</?\\w+#', $args['stopwords'] ) ) {
289
+ add_settings_error(
290
+ 'is_settings',
291
+ 'invalid_is_stopwords',
292
+ __( 'Invalid Stopwords', 'add-search-to-menu' ),
293
+ 'error'
294
+ );
295
+ $args['stopwords'] = $this->opt['stopwords'];
296
+ }
297
+
298
+
299
+ if ( isset( $args['custom_css'] ) && preg_match( '#</?\\w+#', $args['synonyms'] ) ) {
300
+ add_settings_error(
301
+ 'is_settings',
302
+ 'invalid_is_synonyms',
303
+ __( 'Invalid Synonyms', 'add-search-to-menu' ),
304
+ 'error'
305
+ );
306
+ $args['synonyms'] = $this->opt['synonyms'];
307
+ }
308
+
309
+ return $args;
310
+ }
311
+
312
  /**
313
  * Displays Search To Menu section description text.
314
  */
511
  $color = ( isset( $this->opt['menu_magnifier_color'] ) ? $this->opt['menu_magnifier_color'] : '#848484' );
512
  ?>
513
  <input style="width: 80px;" class="menu-magnifier-color is-colorpicker" size="5" type="text" id="is-menu-magnifier-color" name="is_menu_search[menu_magnifier_color]" value="<?php
514
+ esc_attr_e( $color );
515
  ?>" />
516
  <br /><i> <?php
517
  esc_html_e( 'Select menu magnifier icon color.', 'add-search-to-menu' );
573
  foreach ( $posts as $post ) {
574
  ?>
575
  <option value="<?php
576
+ esc_attr_e( $post->ID );
577
  ?>" <?php
578
  selected( $post->ID, $check_value, true );
579
  ?>><?php
580
+ esc_html_e( $post->post_title );
581
  ?></option>
582
  <?php
583
  }
590
  <a href="<?php
591
  echo esc_url( menu_page_url( 'ivory-search', false ) ) ;
592
  ?>&post=<?php
593
+ echo esc_url_raw( $check_value ) ;
594
  ?>&action=edit"> <?php
595
  esc_html_e( 'Edit Search Form', 'add-search-to-menu' );
596
  ?></a>
731
  foreach ( $posts as $post ) {
732
  ?>
733
  <option value="<?php
734
+ esc_attr_e( $post->ID );
735
  ?>" <?php
736
  selected( $post->ID, $check_value, true );
737
  ?>><?php
738
+ esc_html_e( $post->post_title );
739
  ?></option>
740
  <?php
741
  }
799
  foreach ( $posts as $post ) {
800
  ?>
801
  <option value="<?php
802
+ esc_attr_e( $post->ID );
803
  ?>" <?php
804
  selected( $post->ID, $check_value, true );
805
  ?>><?php
806
+ esc_html_e( $post->post_title );
807
  ?></option>
808
  <?php
809
  }
814
  if ( $check_value && get_post_type( $check_value ) ) {
815
  ?>
816
  <a href="<?php
817
+ echo esc_url( menu_page_url( 'ivory-search', false ) ) . '&post=' . esc_url_raw( $check_value ) . '&action=edit' ;
818
  ?>"> <?php
819
  esc_html_e( "Edit", 'add-search-to-menu' );
820
  ?></a>
846
  ?>
847
  <div>
848
  <label for="is_search_in_header"><input class="ivory_search_display_in_header" type="checkbox" id="is_search_in_header" name="is_settings[header_menu_search]" value="header_menu_search" <?php
849
+ esc_attr_e( $check_string );
850
  ?>/>
851
  <span class="toggle-check-text"></span><?php
852
  esc_html_e( 'Display search form in site header on mobile devices', 'add-search-to-menu' );
860
  ?>
861
  <div>
862
  <label for="is_site_uses_cache"><input class="ivory_search_display_in_header" type="checkbox" id="is_site_uses_cache" name="is_settings[site_uses_cache]" value="site_uses_cache" <?php
863
+ esc_attr_e( $check_string );
864
  ?>/>
865
  <span class="toggle-check-text"></span><?php
866
  esc_html_e( 'This site uses cache', 'add-search-to-menu' );
966
  ?>]" value="<?php
967
  esc_attr_e( $key );
968
  ?>" <?php
969
+ esc_attr_e( $check_string );
970
  ?>/>
971
  <span class="toggle-check-text"></span><?php
972
  esc_html_e( $file );
admin/partials/search-form.php CHANGED
@@ -70,10 +70,10 @@ if ( ! defined( 'ABSPATH' ) ) {
70
  wp_nonce_field( 'is-save-search-form_' . $post_id );
71
  }
72
  ?>
73
- <input type="hidden" id="post_ID" name="post_ID" value="<?php echo (int) $post_id; ?>" />
74
  <input type="hidden" id="is_locale" name="is_locale" value="<?php echo esc_attr( $post->locale() ); ?>" />
75
  <input type="hidden" id="hiddenaction" name="action" value="save" />
76
- <input type="hidden" id="tab" name="tab" value="<?php echo $tab; ?>" />
77
 
78
  <div id="poststuff">
79
  <div id="search-body" class="metabox-holder columns-2">
@@ -113,7 +113,7 @@ if ( ! defined( 'ABSPATH' ) ) {
113
  $shortcode_text = esc_attr( $post->shortcode() );
114
  }
115
  ?>
116
- <span class="shortcode wp-ui-highlight"><input type="text" id="is-shortcode" onfocus="this.select();" readonly="readonly" class="large-text code" value="<?php echo $shortcode_text; ?>" title="<?php _e( "Click to copy shortcode", 'add-search-to-menu' ); ?>" /></span>
117
 
118
  </p>
119
  </div>
70
  wp_nonce_field( 'is-save-search-form_' . $post_id );
71
  }
72
  ?>
73
+ <input type="hidden" id="post_ID" name="post_ID" value="<?php esc_attr_e( (int) $post_id ); ?>" />
74
  <input type="hidden" id="is_locale" name="is_locale" value="<?php echo esc_attr( $post->locale() ); ?>" />
75
  <input type="hidden" id="hiddenaction" name="action" value="save" />
76
+ <input type="hidden" id="tab" name="tab" value="<?php esc_attr_e( $tab ); ?>" />
77
 
78
  <div id="poststuff">
79
  <div id="search-body" class="metabox-holder columns-2">
113
  $shortcode_text = esc_attr( $post->shortcode() );
114
  }
115
  ?>
116
+ <span class="shortcode wp-ui-highlight"><input type="text" id="is-shortcode" onfocus="this.select();" readonly="readonly" class="large-text code" value="<?php esc_attr_e( $shortcode_text ); ?>" title="<?php _e( "Click to copy shortcode", 'add-search-to-menu' ); ?>" /></span>
117
 
118
  </p>
119
  </div>
admin/partials/settings-form.php CHANGED
@@ -62,14 +62,14 @@ if ( ! defined( 'ABSPATH' ) ) {
62
  break;
63
  }
64
  }
65
- $url = esc_url( menu_page_url( 'ivory-search-settings', false ) );
66
  ?>
67
  <ul id="search-form-editor-tabs">
68
  <?php
69
  foreach ( $panels as $id => $panel ) {
70
  $class = ( $tab == $id ) ? 'active' : '';
71
  echo sprintf( '<li id="%1$s-tab" class="%2$s"><a href="%3$s" title="%4$s">%5$s</a></li>',
72
- esc_attr( $panel[0] ), esc_attr( $class ), $url . '&tab=' . $panel[0], esc_attr( $panel[2] ), esc_html( $panel[1] ) );
73
  }
74
  ?>
75
  </ul>
62
  break;
63
  }
64
  }
65
+ $url = menu_page_url( 'ivory-search-settings', false );
66
  ?>
67
  <ul id="search-form-editor-tabs">
68
  <?php
69
  foreach ( $panels as $id => $panel ) {
70
  $class = ( $tab == $id ) ? 'active' : '';
71
  echo sprintf( '<li id="%1$s-tab" class="%2$s"><a href="%3$s" title="%4$s">%5$s</a></li>',
72
+ esc_attr( $panel[0] ), esc_attr( $class ), esc_url( $url ) . '&tab=' . $panel[0], esc_attr( $panel[2] ), esc_html( $panel[1] ) );
73
  }
74
  ?>
75
  </ul>
includes/class-is-search-form.php CHANGED
@@ -227,16 +227,6 @@ class IS_Search_Form {
227
  }
228
  }
229
 
230
- // Return true if this form is the same one as currently POSTed.
231
- public function is_posted() {
232
-
233
- if ( empty( $_POST['_is_unit_tag'] ) ) {
234
- return false;
235
- }
236
-
237
- return $this->unit_tag == $_POST['_is_unit_tag'];
238
- }
239
-
240
  /**
241
  * Get Customizer Generated CSS
242
  *
@@ -405,8 +395,10 @@ class IS_Search_Form {
405
  $result = '';
406
  $search_form = false;
407
  $enabled_customization = false;
 
408
  $is_opt = Ivory_Search::load_options();
409
  $min = ( defined( 'IS_DEBUG' ) && IS_DEBUG ) ? '' : '.min';
 
410
 
411
  if ( $args['id'] ) {
412
  $search_form = IS_Search_Form::get_instance( $args['id'] );
@@ -427,9 +419,9 @@ class IS_Search_Form {
427
 
428
  if ( $enabled_customization ) {
429
  $inline_css = $this->get_css( $args['id'] );
430
- if ( '' !== $inline_css && ! ivory_search_is_json_request() ) {
431
- echo '<style type="text/css">' . $inline_css . '</style>';
432
- }
433
  }
434
 
435
  if ( isset( $_settings['disable'] ) ) {
@@ -447,13 +439,13 @@ class IS_Search_Form {
447
  add_filter( 'get_search_form', array( IS_Admin_Public::getInstance(), 'get_search_form' ), 9999999 );
448
 
449
  if ( 'n' !== $display_id ) {
450
- $result = preg_replace('/<\/form>/', '<input type="hidden" name="id" value="' . $args['id'] . '" /></form>', $result );
451
  }
452
  if ( ! isset( $_includes['post_type_url'] ) && isset( $_includes['post_type'] ) && count( $_includes['post_type'] ) < 2 ) {
453
- $result = preg_replace('/<\/form>/', '<input type="hidden" name="post_type" value="' . reset( $_includes['post_type'] ) . '" /></form>', $result );
454
  }
455
- if ( isset( $_GET['lang'] ) ) {
456
- $result = preg_replace('/<\/form>/', '<input type="hidden" name="lang" value="' . $_GET['lang'] . '" /></form>', $result );
457
  }
458
 
459
  $result = apply_filters( 'is_default_search_form', $result );
@@ -482,21 +474,21 @@ class IS_Search_Form {
482
  wp_enqueue_script( 'ivory-ajax-search-scripts' );
483
  if ( ! ivory_search_is_json_request() && isset( $_settings['highlight_terms'] ) ) {
484
  wp_enqueue_script( 'is-highlight' );
485
- if ( isset( $_settings['highlight_color'] ) && ! empty( $_settings['highlight_color'] ) && ! is_search() ) {
486
- echo '<style type="text/css" media="screen">';
487
- echo '#is-ajax-search-result-' . $args['id'].' .is-highlight { background-color: '.$_settings['highlight_color'].' !important;}';
488
- echo '#is-ajax-search-result-' . $args['id'].' .meta .is-highlight { background-color: transparent !important;}';
489
- echo '</style>';
490
- }
491
  }
492
 
493
  $min_no_for_search = isset( $_ajax['min_no_for_search'] ) ? $_ajax['min_no_for_search'] : '1';
494
  $result_box_max_height = isset( $_ajax['result_box_max_height'] ) ? $_ajax['result_box_max_height'] : '400';
495
 
496
  // Add data AJAX attributes.
497
- $data_attrs = 'data-min-no-for-search="'.esc_attr( $min_no_for_search ).'"';
498
- $data_attrs .= ' data-result-box-max-height="'.$result_box_max_height.'"';
499
- $data_attrs .= ' data-form-id="'.$args['id'].'"';
500
  }
501
 
502
  $temp = ( 'is-form-style-default' !== $form_style ) ? 'is-form-style ' : '';
@@ -522,34 +514,37 @@ class IS_Search_Form {
522
  }
523
  }
524
 
525
- $result = '<form '.$data_attrs.' class="is-search-form '. $classes .'" action="' . $search_url . '" method="get" role="search" >';
526
  $autocomplete = apply_filters( 'is_search_form_autocomplete', 'autocomplete="off"' );
527
- $search_val = ( isset( $_GET['id'] ) && $_GET['id'] === $args['id'] ) ? get_search_query() : '';
528
- $result .= '<label for="is-search-input-' . $args['id'] . '"><span class="is-screen-reader-text">'.__( 'Search for:', 'add-search-to-menu').'</span><input type="search" id="is-search-input-' . $args['id'] . '" name="s" value="' . $search_val.'" class="is-search-input" placeholder="' . esc_attr( $placeholder_text ) . '" '.$autocomplete.' />';
 
 
 
529
  // AJAX Loader.
530
  if ( isset( $_ajax['enable_ajax'] ) ) {
531
  $loader_image = isset( $settings['loader-image'] ) ? $settings['loader-image'] : IS_PLUGIN_URI . 'public/images/spinner.gif';
532
  if ( $loader_image ) {
533
- $result .= '<span class="is-loader-image" style="display: none;background-image:url('.$loader_image.');" ></span>';
534
  }
535
  }
536
  $result .= '</label>';
537
  if ( 'is-form-style-3' === $form_style ) {
538
  $result .= '<button type="submit" class="is-search-submit"><span class="is-screen-reader-text">'.__( 'Search Button', 'add-search-to-menu').'</span><span class="is-search-icon"><svg focusable="false" aria-label="' . __( "Search", "ivory-search" ) . '" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24px"><path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"></path></svg></span></button>';
539
  } else if ( 'is-form-style-2' !== $form_style ) {
540
- $result .= '<input type="submit" value="' . esc_html( $search_btn_text ) . '" class="is-search-submit" />';
541
  }
542
 
543
  if ( 'n' !== $display_id ) {
544
- $result .= '<input type="hidden" name="id" value="' . $args['id'] . '" />';
545
  }
546
 
547
  if ( ! isset( $_includes['post_type_url'] ) && isset( $_includes['post_type'] ) && count( $_includes['post_type'] ) < 2 ) {
548
- $result .= '<input type="hidden" name="post_type" value="' . reset( $_includes['post_type'] ) . '" />';
549
  }
550
 
551
- if ( isset( $_GET['lang'] ) ) {
552
- $result .= '<input type="hidden" name="lang" value="' . $_GET['lang'] . '" />';
553
  }
554
  $result .= '</form>';
555
 
@@ -557,11 +552,11 @@ class IS_Search_Form {
557
  }
558
 
559
  if ( isset( $is_opt['easy_edit'] ) && is_user_logged_in() && current_user_can( 'administrator' ) ) {
560
- $result .= '<div class="is-link-container"><div><a class="is-edit-link" target="_blank" href="'.admin_url( 'admin.php?page=ivory-search&post='.$args['id'].'&action=edit' ) . '">'.__( "Edit", "ivory-search") .'</a>';
561
 
562
  if ( ! is_customize_preview() ) {
563
  if ( $enabled_customization ) {
564
- $result .= ' <a class="is-customize-link" target="_blank" href="'.admin_url( 'customize.php?autofocus[section]=is_section_'.$args['id'].'&url=' . get_the_permalink( get_the_ID() ) ) .'">'.__( "Customizer", "ivory-search") .'</a>';
565
  }
566
  }
567
  $result .= '</div></div>';
227
  }
228
  }
229
 
 
 
 
 
 
 
 
 
 
 
230
  /**
231
  * Get Customizer Generated CSS
232
  *
395
  $result = '';
396
  $search_form = false;
397
  $enabled_customization = false;
398
+ $is_site_lang = isset( $_GET['lang'] ) ? sanitize_text_field($_GET['lang']) : false;
399
  $is_opt = Ivory_Search::load_options();
400
  $min = ( defined( 'IS_DEBUG' ) && IS_DEBUG ) ? '' : '.min';
401
+ $is_site_lang = isset( $_GET['lang'] ) ? sanitize_text_field( $_GET['lang'] ) : false;
402
 
403
  if ( $args['id'] ) {
404
  $search_form = IS_Search_Form::get_instance( $args['id'] );
419
 
420
  if ( $enabled_customization ) {
421
  $inline_css = $this->get_css( $args['id'] );
422
+ if ( '' !== $inline_css && ! ivory_search_is_json_request() ) { ?>
423
+ <style type="text/css"><?php if ( ! preg_match( '#</?\w+#', $inline_css ) ) { esc_attr_e( $inline_css ); } ?></style>
424
+ <?php }
425
  }
426
 
427
  if ( isset( $_settings['disable'] ) ) {
439
  add_filter( 'get_search_form', array( IS_Admin_Public::getInstance(), 'get_search_form' ), 9999999 );
440
 
441
  if ( 'n' !== $display_id ) {
442
+ $result = preg_replace('/<\/form>/', '<input type="hidden" name="id" value="' . esc_attr( $args['id'] ) . '" /></form>', $result );
443
  }
444
  if ( ! isset( $_includes['post_type_url'] ) && isset( $_includes['post_type'] ) && count( $_includes['post_type'] ) < 2 ) {
445
+ $result = preg_replace('/<\/form>/', '<input type="hidden" name="post_type" value="' . esc_attr( reset( $_includes['post_type'] ) ) . '" /></form>', $result );
446
  }
447
+ if ( $is_site_lang ) {
448
+ $result = preg_replace('/<\/form>/', '<input type="hidden" name="lang" value="' . esc_attr( $is_site_lang ) . '" /></form>', $result );
449
  }
450
 
451
  $result = apply_filters( 'is_default_search_form', $result );
474
  wp_enqueue_script( 'ivory-ajax-search-scripts' );
475
  if ( ! ivory_search_is_json_request() && isset( $_settings['highlight_terms'] ) ) {
476
  wp_enqueue_script( 'is-highlight' );
477
+ if ( isset( $_settings['highlight_color'] ) && ! empty( $_settings['highlight_color'] ) && ! is_search() ) { ?>
478
+ <style type="text/css" media="screen">
479
+ #is-ajax-search-result-<?php esc_html_e( $args['id'] ); ?> .is-highlight { background-color: <?php esc_html_e( $_settings['highlight_color'] ); ?> !important;}
480
+ #is-ajax-search-result-<?php esc_html_e( $args['id'] ); ?> .meta .is-highlight { background-color: transparent !important;}
481
+ </style>
482
+ <?php }
483
  }
484
 
485
  $min_no_for_search = isset( $_ajax['min_no_for_search'] ) ? $_ajax['min_no_for_search'] : '1';
486
  $result_box_max_height = isset( $_ajax['result_box_max_height'] ) ? $_ajax['result_box_max_height'] : '400';
487
 
488
  // Add data AJAX attributes.
489
+ $data_attrs = 'data-min-no-for-search='. $min_no_for_search;
490
+ $data_attrs .= ' data-result-box-max-height='.$result_box_max_height;
491
+ $data_attrs .= ' data-form-id='.$args['id'];
492
  }
493
 
494
  $temp = ( 'is-form-style-default' !== $form_style ) ? 'is-form-style ' : '';
514
  }
515
  }
516
 
517
+ $result = '<form '.esc_attr( $data_attrs ).' class="is-search-form '. esc_attr( $classes ) .'" action="' . esc_url( $search_url ) . '" method="get" role="search" >';
518
  $autocomplete = apply_filters( 'is_search_form_autocomplete', 'autocomplete="off"' );
519
+
520
+ $is_form_id = ( isset( $_GET['id'] ) && is_numeric( $_GET['id'] ) ) ? sanitize_key( $_GET['id'] ) : false;
521
+ $search_val = ( $is_form_id && $is_form_id === $args['id'] ) ? get_search_query() : '';
522
+ $result .= '<label for="is-search-input-' . esc_attr( $args['id'] ) . '"><span class="is-screen-reader-text">'.__( 'Search for:', 'add-search-to-menu').'</span><input type="search" id="is-search-input-' . esc_attr( $args['id'] ) . '" name="s" value="' . esc_attr( $search_val ).'" class="is-search-input" placeholder="' . esc_attr( $placeholder_text ) . '" '. esc_attr( $autocomplete ) .' />';
523
+
524
  // AJAX Loader.
525
  if ( isset( $_ajax['enable_ajax'] ) ) {
526
  $loader_image = isset( $settings['loader-image'] ) ? $settings['loader-image'] : IS_PLUGIN_URI . 'public/images/spinner.gif';
527
  if ( $loader_image ) {
528
+ $result .= '<span class="is-loader-image" style="display: none;background-image:url('.esc_url( $loader_image).');" ></span>';
529
  }
530
  }
531
  $result .= '</label>';
532
  if ( 'is-form-style-3' === $form_style ) {
533
  $result .= '<button type="submit" class="is-search-submit"><span class="is-screen-reader-text">'.__( 'Search Button', 'add-search-to-menu').'</span><span class="is-search-icon"><svg focusable="false" aria-label="' . __( "Search", "ivory-search" ) . '" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24px"><path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"></path></svg></span></button>';
534
  } else if ( 'is-form-style-2' !== $form_style ) {
535
+ $result .= '<input type="submit" value="' . esc_attr( $search_btn_text ) . '" class="is-search-submit" />';
536
  }
537
 
538
  if ( 'n' !== $display_id ) {
539
+ $result .= '<input type="hidden" name="id" value="' . esc_attr( $args['id'] ) . '" />';
540
  }
541
 
542
  if ( ! isset( $_includes['post_type_url'] ) && isset( $_includes['post_type'] ) && count( $_includes['post_type'] ) < 2 ) {
543
+ $result .= '<input type="hidden" name="post_type" value="' . esc_attr( reset( $_includes['post_type'] ) ) . '" />';
544
  }
545
 
546
+ if ( $is_site_lang ) {
547
+ $result .= '<input type="hidden" name="lang" value="' . esc_attr( $is_site_lang ) . '" />';
548
  }
549
  $result .= '</form>';
550
 
552
  }
553
 
554
  if ( isset( $is_opt['easy_edit'] ) && is_user_logged_in() && current_user_can( 'administrator' ) ) {
555
+ $result .= '<div class="is-link-container"><div><a class="is-edit-link" target="_blank" href="'.admin_url( 'admin.php?page=ivory-search&post='.esc_url_raw( $args['id'] ).'&action=edit' ) . '">'.__( "Edit", "ivory-search") .'</a>';
556
 
557
  if ( ! is_customize_preview() ) {
558
  if ( $enabled_customization ) {
559
+ $result .= ' <a class="is-customize-link" target="_blank" href="'.admin_url( 'customize.php?autofocus[section]=is_section_'.esc_url_raw( $args['id'] ).'&url=' . get_the_permalink( get_the_ID() ) ) .'">'.__( "Customizer", "ivory-search") .'</a>';
560
  }
561
  }
562
  $result .= '</div></div>';
includes/class-is-widget.php CHANGED
@@ -29,13 +29,13 @@ class IS_Widget extends WP_Widget {
29
  echo $args['before_title'] . apply_filters( 'widget_title', $instance['title'] ) . $args['after_title'];
30
  }
31
  if ( ! empty( $instance['search_form'] ) ) {
32
- echo do_shortcode( '[ivory-search id="' . $instance['search_form'] . '"]' );
33
  } else {
34
  $page = get_page_by_path( 'default-search-form', OBJECT, 'is_search_form' );
35
  if ( ! empty( $page ) ) {
36
- echo do_shortcode( '[ivory-search id="' . $page->ID . '"]' );
37
  } else {
38
- _e( 'Please select search form in the Ivory Search widget.', 'add-search-to-menu' );
39
  }
40
  }
41
  echo $args['after_widget'];
@@ -63,28 +63,28 @@ class IS_Widget extends WP_Widget {
63
 
64
  $posts = get_posts( $args );
65
 
66
- if ( ! empty( $posts ) ) {
67
- $html .= '<label for="'. esc_attr( $this->get_field_id( 'search_form' ) ) .'">'. esc_attr_e( 'Search Form:', 'add-search-to-menu' ) .'</label>';
68
- $html .= '<select class="widefat" id="'.esc_attr( $this->get_field_id( 'search_form' ) ).'" name="'.esc_attr( $this->get_field_name( 'search_form' ) ).'" >';
69
- $html .= '<option value="0">' . __( 'Click to select Search Form', 'add-search-to-menu' ) . '</option>';
70
- if ( ! isset( $instance['search_form'] ) && ! $search_form ) {
71
  foreach ($posts as $val) {
72
  if ( 'default-search-form' === $val->post_name ) {
73
  $search_form = $val->ID;
74
  }
75
  }
76
  }
77
- foreach ( $posts as $post ) {
78
- $html .= '<option value="' . $post->ID . '"' . selected( $post->ID, $search_form, false ) . ' >' . $post->post_title . '</option>';
79
- }
80
 
81
- $html .= '</select>';
82
- if ( $search_form && get_post_type( $search_form ) ) {
83
- $html .= '<a href="' . get_admin_url( null, 'admin.php?page=ivory-search&post='.$search_form.'&action=edit' ) . '"> ' . esc_html__( "Edit", 'add-search-to-menu' ) . '</a>';
84
- } else {
85
- $html .= '<a href="' . get_admin_url( null, 'admin.php?page=ivory-search-new' ) . '"> ' . esc_html__( "Create New", 'add-search-to-menu' ) . '</a>';
86
- }
87
- echo $html;
88
  }
89
  ?>
90
  </p>
29
  echo $args['before_title'] . apply_filters( 'widget_title', $instance['title'] ) . $args['after_title'];
30
  }
31
  if ( ! empty( $instance['search_form'] ) ) {
32
+ echo do_shortcode( '[ivory-search id="' . esc_attr( $instance['search_form'] ) . '"]' );
33
  } else {
34
  $page = get_page_by_path( 'default-search-form', OBJECT, 'is_search_form' );
35
  if ( ! empty( $page ) ) {
36
+ echo do_shortcode( '[ivory-search id="' . esc_attr( $page->ID ) . '"]' );
37
  } else {
38
+ esc_html_e( 'Please select search form in the Ivory Search widget.', 'add-search-to-menu' );
39
  }
40
  }
41
  echo $args['after_widget'];
63
 
64
  $posts = get_posts( $args );
65
 
66
+ if ( ! empty( $posts ) ) { ?>
67
+ <label for="<?php esc_attr_e( $this->get_field_id( 'search_form' ) ); ?>"><?php esc_attr_e( 'Search Form:', 'add-search-to-menu' ); ?></label>
68
+ <select class="widefat" id="<?php esc_attr_e( $this->get_field_id( 'search_form' ) ); ?>" name="<?php esc_attr_e( $this->get_field_name( 'search_form' ) ); ?>" >
69
+ <option value="0"><?php _e( 'Click to select Search Form', 'add-search-to-menu' ); ?></option>
70
+ <?php if ( ! isset( $instance['search_form'] ) && ! $search_form ) {
71
  foreach ($posts as $val) {
72
  if ( 'default-search-form' === $val->post_name ) {
73
  $search_form = $val->ID;
74
  }
75
  }
76
  }
77
+ foreach ( $posts as $post ) { ?>
78
+ <option value="<?php esc_attr_e( $post->ID ); ?>" <?php selected( $post->ID, $search_form ); ?> ><?php esc_html_e( $post->post_title ); ?></option>
79
+ <?php } ?>
80
 
81
+ </select>
82
+ <?php if ( $search_form && get_post_type( $search_form ) ) { ?>
83
+ <a href="<?php echo get_admin_url( null, 'admin.php?page=ivory-search&post='.$search_form.'&action=edit' ); ?>"> <?php esc_html_e( "Edit Search Form", 'add-search-to-menu' ); ?></a>
84
+ <?php } else { ?>
85
+ <a href="<?php echo get_admin_url( null, 'admin.php?page=ivory-search-new' ); ?>"><?php esc_html_e( "Create New Search Form", 'add-search-to-menu' ); ?></a>
86
+ <?php }
87
+
88
  }
89
  ?>
90
  </p>
includes/class-is.php CHANGED
@@ -170,7 +170,7 @@ class IS_Loader {
170
  /**
171
  * Displays search form by processing shortcode.
172
  */
173
- function search_form_shortcode( $atts ) {
174
 
175
  if ( is_feed() ) {
176
  return '[ivory-search]';
@@ -185,15 +185,19 @@ class IS_Loader {
185
  'id' => 0,
186
  'title' => '',
187
  ),
188
- $atts, 'ivory-search'
189
  );
190
 
191
- $id = (int) $atts['id'];
192
 
193
- $search_form = IS_Search_Form::get_instance( $id );
 
 
 
 
194
 
195
  if ( ! $search_form ) {
196
- return '[ivory-search 404 "The search form '.$id.' does not exist"]';
197
  }
198
 
199
  $form = $search_form->form_html( $atts );
170
  /**
171
  * Displays search form by processing shortcode.
172
  */
173
+ function search_form_shortcode( $args ) {
174
 
175
  if ( is_feed() ) {
176
  return '[ivory-search]';
185
  'id' => 0,
186
  'title' => '',
187
  ),
188
+ $args, 'ivory-search'
189
  );
190
 
191
+ $atts = array_map( 'sanitize_text_field', $atts );
192
 
193
+ if ( ! is_numeric( $atts['id'] ) || 0 == $atts['id'] ) {
194
+ return '[ivory-search 404 "Invalid search form ID '. esc_html( $atts['id'] ) .'"]';
195
+ }
196
+
197
+ $search_form = IS_Search_Form::get_instance( $atts['id'] );
198
 
199
  if ( ! $search_form ) {
200
+ return '[ivory-search 404 "The search form '. esc_html( $atts['id'] ) .' does not exist"]';
201
  }
202
 
203
  $form = $search_form->form_html( $atts );
languages/add-search-to-menu.pot CHANGED
@@ -2,7 +2,7 @@
2
  msgid ""
3
  msgstr ""
4
  "Project-Id-Version: Ivory Search\n"
5
- "POT-Creation-Date: 2021-10-01 21:10+0530\n"
6
  "PO-Revision-Date: 2020-03-17 21:05+0530\n"
7
  "Last-Translator: \n"
8
  "Language-Team: Ivory Search <admin@ivorysearch.com>\n"
@@ -21,8 +21,8 @@ msgstr ""
21
  msgid "The changes you made will be lost if you navigate away from this page."
22
  msgstr ""
23
 
24
- #: ../admin/class-is-admin.php:138 ../admin/class-is-settings-fields.php:374
25
- #: ../admin/partials/search-form.php:23
26
  msgid "Edit Search Form"
27
  msgstr ""
28
 
@@ -151,48 +151,44 @@ msgstr ""
151
  msgid "Ivory Search Settings"
152
  msgstr ""
153
 
154
- #: ../admin/class-is-admin.php:499
155
  #, php-format
156
  msgid "Search results for &#8220;%s&#8221;"
157
  msgstr ""
158
 
159
- #: ../admin/class-is-admin.php:510
160
  msgid "Find Search Forms"
161
  msgstr ""
162
 
163
- #: ../admin/class-is-admin.php:554
164
  msgid "You are not allowed to edit this item."
165
  msgstr ""
166
 
167
- #: ../admin/class-is-admin.php:648
168
  msgid "You are not allowed to reset this item."
169
  msgstr ""
170
 
171
- #: ../admin/class-is-admin.php:684
172
  msgid "You are not allowed to copy this item."
173
  msgstr ""
174
 
175
- #: ../admin/class-is-admin.php:725
176
  msgid "You are not allowed to delete this item."
177
  msgstr ""
178
 
179
- #: ../admin/class-is-admin.php:729
180
  msgid "Error in deleting."
181
  msgstr ""
182
 
183
- #: ../admin/class-is-admin.php:969
184
- msgid "Save Form"
185
- msgstr ""
186
-
187
- #: ../admin/class-is-admin.php:981
188
  msgid "Upgrade to Pro to Access"
189
  msgstr ""
190
 
191
- #: ../admin/class-is-admin.php:988
192
  msgid "Install Premium Version to Access"
193
  msgstr ""
194
 
195
- #: ../admin/class-is-admin.php:990
196
  msgid "Upgrade to Pro Plus to Access"
197
  msgstr ""
198
 
@@ -202,8 +198,8 @@ msgstr ""
202
 
203
  #: ../admin/class-is-editor.php:113 ../admin/partials/search-form.php:130
204
  #: ../includes/class-is-admin-public.php:186
205
- #: ../includes/class-is-search-form.php:469
206
- #: ../includes/class-is-search-form.php:538 ../public/class-is-public.php:207
207
  #: ../public/class-is-public.php:256
208
  msgid "Search"
209
  msgstr ""
@@ -511,7 +507,7 @@ msgstr ""
511
  msgid "Enable Search Form Customization"
512
  msgstr ""
513
 
514
- #: ../admin/class-is-editor.php:693 ../includes/class-is-search-form.php:564
515
  msgid "Customizer"
516
  msgstr ""
517
 
@@ -990,10 +986,10 @@ msgid ""
990
  "allow you to manage your search form. You can perform the following actions:"
991
  msgstr ""
992
 
993
- #: ../admin/class-is-help.php:79 ../admin/class-is-list-table.php:154
994
- #: ../admin/class-is-settings-fields.php:458
995
- #: ../admin/class-is-settings-fields.php:488
996
- #: ../includes/class-is-search-form.php:560 ../includes/class-is-widget.php:83
997
  msgid "Edit"
998
  msgstr ""
999
 
@@ -1003,7 +999,7 @@ msgid ""
1003
  "that screen by clicking on the search form title."
1004
  msgstr ""
1005
 
1006
- #: ../admin/class-is-help.php:80 ../admin/class-is-list-table.php:164
1007
  #: ../admin/partials/search-form.php:204
1008
  msgid "Duplicate"
1009
  msgstr ""
@@ -1014,8 +1010,8 @@ msgid ""
1014
  "original, but has a different ID."
1015
  msgstr ""
1016
 
1017
- #: ../admin/class-is-help.php:81 ../admin/class-is-list-table.php:115
1018
- #: ../admin/class-is-list-table.php:178 ../admin/partials/search-form.php:189
1019
  msgid "Delete"
1020
  msgstr ""
1021
 
@@ -1119,27 +1115,27 @@ msgstr ""
1119
  msgid "Shortcode"
1120
  msgstr ""
1121
 
1122
- #: ../admin/class-is-list-table.php:144
1123
  #, php-format
1124
  msgid "Edit &#8220;%s&#8221;"
1125
  msgstr ""
1126
 
1127
- #: ../admin/class-is-list-table.php:177 ../admin/partials/search-form.php:189
1128
  msgid ""
1129
  "You are about to delete this search form.\n"
1130
  " 'Cancel' to stop, 'OK' to delete."
1131
  msgstr ""
1132
 
1133
- #: ../admin/class-is-list-table.php:210
1134
  msgid "Y/m/d g:i:s A"
1135
  msgstr ""
1136
 
1137
- #: ../admin/class-is-list-table.php:221
1138
  #, php-format
1139
  msgid "%s ago"
1140
  msgstr ""
1141
 
1142
- #: ../admin/class-is-list-table.php:223
1143
  msgid "d/m/Y"
1144
  msgstr ""
1145
 
@@ -1180,279 +1176,291 @@ msgid "Menu Search Settings"
1180
  msgstr ""
1181
 
1182
  #: ../admin/class-is-settings-fields.php:178
1183
- #: ../admin/class-is-settings-fields.php:199
1184
  msgid "Search Analytics"
1185
  msgstr ""
1186
 
1187
- #: ../admin/class-is-settings-fields.php:189
1188
- msgid "Configure Menu Search"
 
 
 
 
 
 
 
 
1189
  msgstr ""
1190
 
1191
  #: ../admin/class-is-settings-fields.php:209
 
 
 
 
1192
  msgid "Advanced Website Search Settings"
1193
  msgstr ""
1194
 
1195
- #: ../admin/class-is-settings-fields.php:221
1196
  msgid "Display search form on selected menu locations."
1197
  msgstr ""
1198
 
1199
- #: ../admin/class-is-settings-fields.php:237
1200
  #, php-format
1201
  msgid "No menu assigned to navigation menu location in the %sMenus screen%s."
1202
  msgstr ""
1203
 
1204
- #: ../admin/class-is-settings-fields.php:240
1205
  msgid "Navigation menu location is not registered on the site."
1206
  msgstr ""
1207
 
1208
- #: ../admin/class-is-settings-fields.php:249
1209
  msgid "Display search form on selected menus."
1210
  msgstr ""
1211
 
1212
- #: ../admin/class-is-settings-fields.php:264
1213
  #, php-format
1214
  msgid "No menu created in the %sMenus screen%s."
1215
  msgstr ""
1216
 
1217
- #: ../admin/class-is-settings-fields.php:285
1218
  msgid "Display search form at the start of the navigation menu"
1219
  msgstr ""
1220
 
1221
- #: ../admin/class-is-settings-fields.php:291
1222
  msgid "Select menu search form style."
1223
  msgstr ""
1224
 
1225
- #: ../admin/class-is-settings-fields.php:295
1226
  msgid "Default"
1227
  msgstr ""
1228
 
1229
- #: ../admin/class-is-settings-fields.php:296
1230
  msgid "Dropdown"
1231
  msgstr ""
1232
 
1233
- #: ../admin/class-is-settings-fields.php:297
1234
  msgid "Sliding"
1235
  msgstr ""
1236
 
1237
- #: ../admin/class-is-settings-fields.php:298
1238
  msgid "Full Width"
1239
  msgstr ""
1240
 
1241
- #: ../admin/class-is-settings-fields.php:299
1242
  msgid "Popup"
1243
  msgstr ""
1244
 
1245
- #: ../admin/class-is-settings-fields.php:326
1246
  msgid "Select menu magnifier icon color."
1247
  msgstr ""
1248
 
1249
- #: ../admin/class-is-settings-fields.php:339
1250
  msgid "Display search form close icon"
1251
  msgstr ""
1252
 
1253
- #: ../admin/class-is-settings-fields.php:346
1254
  msgid "Add menu title to display in place of search icon."
1255
  msgstr ""
1256
 
1257
- #: ../admin/class-is-settings-fields.php:356
1258
  msgid "Select search form that will control menu search functionality."
1259
  msgstr ""
1260
 
1261
- #: ../admin/class-is-settings-fields.php:367
1262
- #: ../admin/class-is-settings-fields.php:450
1263
- #: ../admin/class-is-settings-fields.php:482
1264
  msgid "None"
1265
  msgstr ""
1266
 
1267
- #: ../admin/class-is-settings-fields.php:376
1268
- #: ../admin/class-is-settings-fields.php:460
1269
- #: ../admin/class-is-settings-fields.php:490 ../includes/class-is-widget.php:85
1270
  msgid "Create New"
1271
  msgstr ""
1272
 
1273
- #: ../admin/class-is-settings-fields.php:384
1274
  msgid "Add class to search form menu item."
1275
  msgstr ""
1276
 
1277
- #: ../admin/class-is-settings-fields.php:390
1278
  msgid "Add multiple classes seperated by space."
1279
  msgstr ""
1280
 
1281
- #: ../admin/class-is-settings-fields.php:396
1282
  msgid ""
1283
  "Add Google Custom Search( CSE ) search form code that will replace default "
1284
  "search form."
1285
  msgstr ""
1286
 
1287
- #: ../admin/class-is-settings-fields.php:414
1288
  msgid "Enabled"
1289
  msgstr ""
1290
 
1291
- #: ../admin/class-is-settings-fields.php:415
1292
  msgid "Disabled"
1293
  msgstr ""
1294
 
1295
- #: ../admin/class-is-settings-fields.php:416
1296
  msgid "Google Analytics tracking for searches"
1297
  msgstr ""
1298
 
1299
- #: ../admin/class-is-settings-fields.php:417
1300
  msgid "Search Analytics uses Google Analytics to track searches."
1301
  msgstr ""
1302
 
1303
- #: ../admin/class-is-settings-fields.php:418
1304
  #, php-format
1305
  msgid "You need %s Google Analytics %s to be installed on your site."
1306
  msgstr ""
1307
 
1308
- #: ../admin/class-is-settings-fields.php:419
1309
  msgid ""
1310
  "Data will be visible inside Google Analytics 'Events' and 'Site Search' "
1311
  "report."
1312
  msgstr ""
1313
 
1314
- #: ../admin/class-is-settings-fields.php:420
1315
  msgid "Events will be as below:"
1316
  msgstr ""
1317
 
1318
- #: ../admin/class-is-settings-fields.php:421
1319
  msgid "Category - Results Found / Nothing Found"
1320
  msgstr ""
1321
 
1322
- #: ../admin/class-is-settings-fields.php:422
1323
  msgid "Action - Ivory Search - ID"
1324
  msgstr ""
1325
 
1326
- #: ../admin/class-is-settings-fields.php:423
1327
  msgid "Label - Value of search term"
1328
  msgstr ""
1329
 
1330
- #: ../admin/class-is-settings-fields.php:424
1331
  #, php-format
1332
  msgid ""
1333
  "Need to %s activate Site Search feature %s inside Google Analytics to "
1334
  "display data inside 'Site Search' report."
1335
  msgstr ""
1336
 
1337
- #: ../admin/class-is-settings-fields.php:425
1338
  msgid ""
1339
  "Enable Site search Tracking option in Site Search Settings and set its "
1340
  "parameters as below."
1341
  msgstr ""
1342
 
1343
- #: ../admin/class-is-settings-fields.php:426
1344
  msgid "Query parameter - s"
1345
  msgstr ""
1346
 
1347
- #: ../admin/class-is-settings-fields.php:427
1348
  msgid "Category parameter - id / result"
1349
  msgstr ""
1350
 
1351
- #: ../admin/class-is-settings-fields.php:438
1352
  msgid "Select search form to display in site header( Not Menu )."
1353
  msgstr ""
1354
 
1355
- #: ../admin/class-is-settings-fields.php:463
1356
  msgid ""
1357
  "Please note that the above option displays search form in site header and "
1358
  "not in navigation menu."
1359
  msgstr ""
1360
 
1361
- #: ../admin/class-is-settings-fields.php:471
1362
  msgid "Select search form to display in site footer."
1363
  msgstr ""
1364
 
1365
- #: ../admin/class-is-settings-fields.php:506
1366
  msgid "Display search form in site header on mobile devices"
1367
  msgstr ""
1368
 
1369
- #: ../admin/class-is-settings-fields.php:509
1370
  msgid ""
1371
  "If this site uses cache then please select the below option to display "
1372
  "search form on mobile."
1373
  msgstr ""
1374
 
1375
- #: ../admin/class-is-settings-fields.php:516
1376
  msgid "This site uses cache"
1377
  msgstr ""
1378
 
1379
- #: ../admin/class-is-settings-fields.php:525
1380
  msgid "Add custom CSS code."
1381
  msgstr ""
1382
 
1383
- #: ../admin/class-is-settings-fields.php:538
1384
  msgid "Add Stopwords that will not be searched."
1385
  msgstr ""
1386
 
1387
- #: ../admin/class-is-settings-fields.php:543
1388
  msgid "Please separate multiple words with commas."
1389
  msgstr ""
1390
 
1391
- #: ../admin/class-is-settings-fields.php:552
1392
  msgid "Add synonyms to make the searches find better results."
1393
  msgstr ""
1394
 
1395
- #: ../admin/class-is-settings-fields.php:554
1396
  msgid ""
1397
  "If you add bird = crow to the list of synonyms, searches for bird "
1398
  "automatically become a search for bird crow and will thus match to posts "
1399
  "that include either bird or crow."
1400
  msgstr ""
1401
 
1402
- #: ../admin/class-is-settings-fields.php:559
1403
  msgid "The format here is key = value"
1404
  msgstr ""
1405
 
1406
- #: ../admin/class-is-settings-fields.php:560
1407
  msgid "Please add every synonyms key = value pairs on new line."
1408
  msgstr ""
1409
 
1410
- #: ../admin/class-is-settings-fields.php:562
1411
  msgid ""
1412
  "This only works for search forms configured to search any of the search "
1413
  "terms(OR) and not all search terms(AND) in the search form Options."
1414
  msgstr ""
1415
 
1416
- #: ../admin/class-is-settings-fields.php:571
1417
  msgid ""
1418
  "Enable below options to disable loading of plugin CSS and JavaScript files."
1419
  msgstr ""
1420
 
1421
- #: ../admin/class-is-settings-fields.php:575
1422
  msgid "Do not load plugin CSS files"
1423
  msgstr ""
1424
 
1425
- #: ../admin/class-is-settings-fields.php:576
1426
  msgid "Do not load plugin JavaScript files"
1427
  msgstr ""
1428
 
1429
- #: ../admin/class-is-settings-fields.php:592
1430
  msgid ""
1431
  "If checked, you have to add following plugin file code into your child theme "
1432
  "CSS file."
1433
  msgstr ""
1434
 
1435
- #: ../admin/class-is-settings-fields.php:597
1436
  msgid ""
1437
  "If checked, you have to add following plugin files code into your child "
1438
  "theme JavaScript file."
1439
  msgstr ""
1440
 
1441
- #: ../admin/class-is-settings-fields.php:614
1442
  msgid "Warning: Use with caution."
1443
  msgstr ""
1444
 
1445
- #: ../admin/class-is-settings-fields.php:619
1446
  msgid ""
1447
  "Do not use Default Search Form to control WordPress default search "
1448
  "functionality"
1449
  msgstr ""
1450
 
1451
- #: ../admin/class-is-settings-fields.php:628
1452
  msgid "Disable search functionality on entire website"
1453
  msgstr ""
1454
 
1455
- #: ../admin/class-is-settings-fields.php:638
1456
  msgid ""
1457
  "Display easy edit links of search form on the website frontend to the admin "
1458
  "users"
@@ -1545,7 +1553,7 @@ msgid "Style 3"
1545
  msgstr ""
1546
 
1547
  #: ../includes/class-is-admin-public.php:173
1548
- #: ../includes/class-is-search-form.php:468
1549
  msgid "Search here..."
1550
  msgstr ""
1551
 
@@ -1554,7 +1562,7 @@ msgid "Text Box Placeholder"
1554
  msgstr ""
1555
 
1556
  #: ../includes/class-is-admin-public.php:190
1557
- #: ../includes/class-is-search-form.php:538
1558
  msgid "Search Button"
1559
  msgstr ""
1560
 
@@ -1587,11 +1595,11 @@ msgstr ""
1587
  msgid "method instead."
1588
  msgstr ""
1589
 
1590
- #: ../includes/class-is-search-form.php:415
1591
  msgid "Invalid search form."
1592
  msgstr ""
1593
 
1594
- #: ../includes/class-is-search-form.php:528
1595
  msgid "Search for:"
1596
  msgstr ""
1597
 
@@ -1607,6 +1615,10 @@ msgstr ""
1607
  msgid "Click to select Search Form"
1608
  msgstr ""
1609
 
 
 
 
 
1610
  #: ../public/class-is-ajax.php:71
1611
  msgid "More results"
1612
  msgstr ""
2
  msgid ""
3
  msgstr ""
4
  "Project-Id-Version: Ivory Search\n"
5
+ "POT-Creation-Date: 2021-11-04 17:16+0530\n"
6
  "PO-Revision-Date: 2020-03-17 21:05+0530\n"
7
  "Last-Translator: \n"
8
  "Language-Team: Ivory Search <admin@ivorysearch.com>\n"
21
  msgid "The changes you made will be lost if you navigate away from this page."
22
  msgstr ""
23
 
24
+ #: ../admin/class-is-admin.php:138 ../admin/class-is-settings-fields.php:394
25
+ #: ../admin/partials/search-form.php:23 ../includes/class-is-widget.php:83
26
  msgid "Edit Search Form"
27
  msgstr ""
28
 
151
  msgid "Ivory Search Settings"
152
  msgstr ""
153
 
154
+ #: ../admin/class-is-admin.php:500
155
  #, php-format
156
  msgid "Search results for &#8220;%s&#8221;"
157
  msgstr ""
158
 
159
+ #: ../admin/class-is-admin.php:511
160
  msgid "Find Search Forms"
161
  msgstr ""
162
 
163
+ #: ../admin/class-is-admin.php:555
164
  msgid "You are not allowed to edit this item."
165
  msgstr ""
166
 
167
+ #: ../admin/class-is-admin.php:649
168
  msgid "You are not allowed to reset this item."
169
  msgstr ""
170
 
171
+ #: ../admin/class-is-admin.php:685
172
  msgid "You are not allowed to copy this item."
173
  msgstr ""
174
 
175
+ #: ../admin/class-is-admin.php:724
176
  msgid "You are not allowed to delete this item."
177
  msgstr ""
178
 
179
+ #: ../admin/class-is-admin.php:728
180
  msgid "Error in deleting."
181
  msgstr ""
182
 
183
+ #: ../admin/class-is-admin.php:967
 
 
 
 
184
  msgid "Upgrade to Pro to Access"
185
  msgstr ""
186
 
187
+ #: ../admin/class-is-admin.php:974
188
  msgid "Install Premium Version to Access"
189
  msgstr ""
190
 
191
+ #: ../admin/class-is-admin.php:976
192
  msgid "Upgrade to Pro Plus to Access"
193
  msgstr ""
194
 
198
 
199
  #: ../admin/class-is-editor.php:113 ../admin/partials/search-form.php:130
200
  #: ../includes/class-is-admin-public.php:186
201
+ #: ../includes/class-is-search-form.php:461
202
+ #: ../includes/class-is-search-form.php:533 ../public/class-is-public.php:207
203
  #: ../public/class-is-public.php:256
204
  msgid "Search"
205
  msgstr ""
507
  msgid "Enable Search Form Customization"
508
  msgstr ""
509
 
510
+ #: ../admin/class-is-editor.php:693 ../includes/class-is-search-form.php:559
511
  msgid "Customizer"
512
  msgstr ""
513
 
986
  "allow you to manage your search form. You can perform the following actions:"
987
  msgstr ""
988
 
989
+ #: ../admin/class-is-help.php:79 ../admin/class-is-list-table.php:158
990
+ #: ../admin/class-is-settings-fields.php:478
991
+ #: ../admin/class-is-settings-fields.php:508
992
+ #: ../includes/class-is-search-form.php:555
993
  msgid "Edit"
994
  msgstr ""
995
 
999
  "that screen by clicking on the search form title."
1000
  msgstr ""
1001
 
1002
+ #: ../admin/class-is-help.php:80 ../admin/class-is-list-table.php:168
1003
  #: ../admin/partials/search-form.php:204
1004
  msgid "Duplicate"
1005
  msgstr ""
1010
  "original, but has a different ID."
1011
  msgstr ""
1012
 
1013
+ #: ../admin/class-is-help.php:81 ../admin/class-is-list-table.php:119
1014
+ #: ../admin/class-is-list-table.php:182 ../admin/partials/search-form.php:189
1015
  msgid "Delete"
1016
  msgstr ""
1017
 
1115
  msgid "Shortcode"
1116
  msgstr ""
1117
 
1118
+ #: ../admin/class-is-list-table.php:148
1119
  #, php-format
1120
  msgid "Edit &#8220;%s&#8221;"
1121
  msgstr ""
1122
 
1123
+ #: ../admin/class-is-list-table.php:181 ../admin/partials/search-form.php:189
1124
  msgid ""
1125
  "You are about to delete this search form.\n"
1126
  " 'Cancel' to stop, 'OK' to delete."
1127
  msgstr ""
1128
 
1129
+ #: ../admin/class-is-list-table.php:214
1130
  msgid "Y/m/d g:i:s A"
1131
  msgstr ""
1132
 
1133
+ #: ../admin/class-is-list-table.php:225
1134
  #, php-format
1135
  msgid "%s ago"
1136
  msgstr ""
1137
 
1138
+ #: ../admin/class-is-list-table.php:227
1139
  msgid "d/m/Y"
1140
  msgstr ""
1141
 
1176
  msgstr ""
1177
 
1178
  #: ../admin/class-is-settings-fields.php:178
1179
+ #: ../admin/class-is-settings-fields.php:219
1180
  msgid "Search Analytics"
1181
  msgstr ""
1182
 
1183
+ #: ../admin/class-is-settings-fields.php:187
1184
+ msgid "Invalid Custom CSS Code"
1185
+ msgstr ""
1186
+
1187
+ #: ../admin/class-is-settings-fields.php:192
1188
+ msgid "Invalid Stopwords"
1189
+ msgstr ""
1190
+
1191
+ #: ../admin/class-is-settings-fields.php:197
1192
+ msgid "Invalid Synonyms"
1193
  msgstr ""
1194
 
1195
  #: ../admin/class-is-settings-fields.php:209
1196
+ msgid "Configure Menu Search"
1197
+ msgstr ""
1198
+
1199
+ #: ../admin/class-is-settings-fields.php:229
1200
  msgid "Advanced Website Search Settings"
1201
  msgstr ""
1202
 
1203
+ #: ../admin/class-is-settings-fields.php:241
1204
  msgid "Display search form on selected menu locations."
1205
  msgstr ""
1206
 
1207
+ #: ../admin/class-is-settings-fields.php:257
1208
  #, php-format
1209
  msgid "No menu assigned to navigation menu location in the %sMenus screen%s."
1210
  msgstr ""
1211
 
1212
+ #: ../admin/class-is-settings-fields.php:260
1213
  msgid "Navigation menu location is not registered on the site."
1214
  msgstr ""
1215
 
1216
+ #: ../admin/class-is-settings-fields.php:269
1217
  msgid "Display search form on selected menus."
1218
  msgstr ""
1219
 
1220
+ #: ../admin/class-is-settings-fields.php:284
1221
  #, php-format
1222
  msgid "No menu created in the %sMenus screen%s."
1223
  msgstr ""
1224
 
1225
+ #: ../admin/class-is-settings-fields.php:305
1226
  msgid "Display search form at the start of the navigation menu"
1227
  msgstr ""
1228
 
1229
+ #: ../admin/class-is-settings-fields.php:311
1230
  msgid "Select menu search form style."
1231
  msgstr ""
1232
 
1233
+ #: ../admin/class-is-settings-fields.php:315
1234
  msgid "Default"
1235
  msgstr ""
1236
 
1237
+ #: ../admin/class-is-settings-fields.php:316
1238
  msgid "Dropdown"
1239
  msgstr ""
1240
 
1241
+ #: ../admin/class-is-settings-fields.php:317
1242
  msgid "Sliding"
1243
  msgstr ""
1244
 
1245
+ #: ../admin/class-is-settings-fields.php:318
1246
  msgid "Full Width"
1247
  msgstr ""
1248
 
1249
+ #: ../admin/class-is-settings-fields.php:319
1250
  msgid "Popup"
1251
  msgstr ""
1252
 
1253
+ #: ../admin/class-is-settings-fields.php:346
1254
  msgid "Select menu magnifier icon color."
1255
  msgstr ""
1256
 
1257
+ #: ../admin/class-is-settings-fields.php:359
1258
  msgid "Display search form close icon"
1259
  msgstr ""
1260
 
1261
+ #: ../admin/class-is-settings-fields.php:366
1262
  msgid "Add menu title to display in place of search icon."
1263
  msgstr ""
1264
 
1265
+ #: ../admin/class-is-settings-fields.php:376
1266
  msgid "Select search form that will control menu search functionality."
1267
  msgstr ""
1268
 
1269
+ #: ../admin/class-is-settings-fields.php:387
1270
+ #: ../admin/class-is-settings-fields.php:470
1271
+ #: ../admin/class-is-settings-fields.php:502
1272
  msgid "None"
1273
  msgstr ""
1274
 
1275
+ #: ../admin/class-is-settings-fields.php:396
1276
+ #: ../admin/class-is-settings-fields.php:480
1277
+ #: ../admin/class-is-settings-fields.php:510
1278
  msgid "Create New"
1279
  msgstr ""
1280
 
1281
+ #: ../admin/class-is-settings-fields.php:404
1282
  msgid "Add class to search form menu item."
1283
  msgstr ""
1284
 
1285
+ #: ../admin/class-is-settings-fields.php:410
1286
  msgid "Add multiple classes seperated by space."
1287
  msgstr ""
1288
 
1289
+ #: ../admin/class-is-settings-fields.php:416
1290
  msgid ""
1291
  "Add Google Custom Search( CSE ) search form code that will replace default "
1292
  "search form."
1293
  msgstr ""
1294
 
1295
+ #: ../admin/class-is-settings-fields.php:434
1296
  msgid "Enabled"
1297
  msgstr ""
1298
 
1299
+ #: ../admin/class-is-settings-fields.php:435
1300
  msgid "Disabled"
1301
  msgstr ""
1302
 
1303
+ #: ../admin/class-is-settings-fields.php:436
1304
  msgid "Google Analytics tracking for searches"
1305
  msgstr ""
1306
 
1307
+ #: ../admin/class-is-settings-fields.php:437
1308
  msgid "Search Analytics uses Google Analytics to track searches."
1309
  msgstr ""
1310
 
1311
+ #: ../admin/class-is-settings-fields.php:438
1312
  #, php-format
1313
  msgid "You need %s Google Analytics %s to be installed on your site."
1314
  msgstr ""
1315
 
1316
+ #: ../admin/class-is-settings-fields.php:439
1317
  msgid ""
1318
  "Data will be visible inside Google Analytics 'Events' and 'Site Search' "
1319
  "report."
1320
  msgstr ""
1321
 
1322
+ #: ../admin/class-is-settings-fields.php:440
1323
  msgid "Events will be as below:"
1324
  msgstr ""
1325
 
1326
+ #: ../admin/class-is-settings-fields.php:441
1327
  msgid "Category - Results Found / Nothing Found"
1328
  msgstr ""
1329
 
1330
+ #: ../admin/class-is-settings-fields.php:442
1331
  msgid "Action - Ivory Search - ID"
1332
  msgstr ""
1333
 
1334
+ #: ../admin/class-is-settings-fields.php:443
1335
  msgid "Label - Value of search term"
1336
  msgstr ""
1337
 
1338
+ #: ../admin/class-is-settings-fields.php:444
1339
  #, php-format
1340
  msgid ""
1341
  "Need to %s activate Site Search feature %s inside Google Analytics to "
1342
  "display data inside 'Site Search' report."
1343
  msgstr ""
1344
 
1345
+ #: ../admin/class-is-settings-fields.php:445
1346
  msgid ""
1347
  "Enable Site search Tracking option in Site Search Settings and set its "
1348
  "parameters as below."
1349
  msgstr ""
1350
 
1351
+ #: ../admin/class-is-settings-fields.php:446
1352
  msgid "Query parameter - s"
1353
  msgstr ""
1354
 
1355
+ #: ../admin/class-is-settings-fields.php:447
1356
  msgid "Category parameter - id / result"
1357
  msgstr ""
1358
 
1359
+ #: ../admin/class-is-settings-fields.php:458
1360
  msgid "Select search form to display in site header( Not Menu )."
1361
  msgstr ""
1362
 
1363
+ #: ../admin/class-is-settings-fields.php:483
1364
  msgid ""
1365
  "Please note that the above option displays search form in site header and "
1366
  "not in navigation menu."
1367
  msgstr ""
1368
 
1369
+ #: ../admin/class-is-settings-fields.php:491
1370
  msgid "Select search form to display in site footer."
1371
  msgstr ""
1372
 
1373
+ #: ../admin/class-is-settings-fields.php:526
1374
  msgid "Display search form in site header on mobile devices"
1375
  msgstr ""
1376
 
1377
+ #: ../admin/class-is-settings-fields.php:529
1378
  msgid ""
1379
  "If this site uses cache then please select the below option to display "
1380
  "search form on mobile."
1381
  msgstr ""
1382
 
1383
+ #: ../admin/class-is-settings-fields.php:536
1384
  msgid "This site uses cache"
1385
  msgstr ""
1386
 
1387
+ #: ../admin/class-is-settings-fields.php:545
1388
  msgid "Add custom CSS code."
1389
  msgstr ""
1390
 
1391
+ #: ../admin/class-is-settings-fields.php:558
1392
  msgid "Add Stopwords that will not be searched."
1393
  msgstr ""
1394
 
1395
+ #: ../admin/class-is-settings-fields.php:563
1396
  msgid "Please separate multiple words with commas."
1397
  msgstr ""
1398
 
1399
+ #: ../admin/class-is-settings-fields.php:572
1400
  msgid "Add synonyms to make the searches find better results."
1401
  msgstr ""
1402
 
1403
+ #: ../admin/class-is-settings-fields.php:574
1404
  msgid ""
1405
  "If you add bird = crow to the list of synonyms, searches for bird "
1406
  "automatically become a search for bird crow and will thus match to posts "
1407
  "that include either bird or crow."
1408
  msgstr ""
1409
 
1410
+ #: ../admin/class-is-settings-fields.php:579
1411
  msgid "The format here is key = value"
1412
  msgstr ""
1413
 
1414
+ #: ../admin/class-is-settings-fields.php:580
1415
  msgid "Please add every synonyms key = value pairs on new line."
1416
  msgstr ""
1417
 
1418
+ #: ../admin/class-is-settings-fields.php:582
1419
  msgid ""
1420
  "This only works for search forms configured to search any of the search "
1421
  "terms(OR) and not all search terms(AND) in the search form Options."
1422
  msgstr ""
1423
 
1424
+ #: ../admin/class-is-settings-fields.php:591
1425
  msgid ""
1426
  "Enable below options to disable loading of plugin CSS and JavaScript files."
1427
  msgstr ""
1428
 
1429
+ #: ../admin/class-is-settings-fields.php:595
1430
  msgid "Do not load plugin CSS files"
1431
  msgstr ""
1432
 
1433
+ #: ../admin/class-is-settings-fields.php:596
1434
  msgid "Do not load plugin JavaScript files"
1435
  msgstr ""
1436
 
1437
+ #: ../admin/class-is-settings-fields.php:612
1438
  msgid ""
1439
  "If checked, you have to add following plugin file code into your child theme "
1440
  "CSS file."
1441
  msgstr ""
1442
 
1443
+ #: ../admin/class-is-settings-fields.php:617
1444
  msgid ""
1445
  "If checked, you have to add following plugin files code into your child "
1446
  "theme JavaScript file."
1447
  msgstr ""
1448
 
1449
+ #: ../admin/class-is-settings-fields.php:634
1450
  msgid "Warning: Use with caution."
1451
  msgstr ""
1452
 
1453
+ #: ../admin/class-is-settings-fields.php:639
1454
  msgid ""
1455
  "Do not use Default Search Form to control WordPress default search "
1456
  "functionality"
1457
  msgstr ""
1458
 
1459
+ #: ../admin/class-is-settings-fields.php:648
1460
  msgid "Disable search functionality on entire website"
1461
  msgstr ""
1462
 
1463
+ #: ../admin/class-is-settings-fields.php:658
1464
  msgid ""
1465
  "Display easy edit links of search form on the website frontend to the admin "
1466
  "users"
1553
  msgstr ""
1554
 
1555
  #: ../includes/class-is-admin-public.php:173
1556
+ #: ../includes/class-is-search-form.php:460
1557
  msgid "Search here..."
1558
  msgstr ""
1559
 
1562
  msgstr ""
1563
 
1564
  #: ../includes/class-is-admin-public.php:190
1565
+ #: ../includes/class-is-search-form.php:533
1566
  msgid "Search Button"
1567
  msgstr ""
1568
 
1595
  msgid "method instead."
1596
  msgstr ""
1597
 
1598
+ #: ../includes/class-is-search-form.php:407
1599
  msgid "Invalid search form."
1600
  msgstr ""
1601
 
1602
+ #: ../includes/class-is-search-form.php:522
1603
  msgid "Search for:"
1604
  msgstr ""
1605
 
1615
  msgid "Click to select Search Form"
1616
  msgstr ""
1617
 
1618
+ #: ../includes/class-is-widget.php:85
1619
+ msgid "Create New Search Form"
1620
+ msgstr ""
1621
+
1622
  #: ../public/class-is-ajax.php:71
1623
  msgid "More results"
1624
  msgstr ""
public/class-is-ajax.php CHANGED
@@ -91,12 +91,12 @@ class IS_Ajax {
91
 
92
  $template = locate_template( 'is-ajax-results.php' );
93
 
94
- if ( ! $template ) {
95
- $template = 'partials/is-ajax-results.php';
 
 
96
  }
97
-
98
- include_once( $template );
99
-
100
  wp_die();
101
  }
102
 
@@ -155,7 +155,7 @@ class IS_Ajax {
155
  if ( $is_markup ) {
156
  do_action( 'is_term_title_markup', $taxonomy, $search_term, $term_title, $wrapper_class, $tags );
157
  } else if( $tags ) { ?>
158
- <div class="<?php echo $wrapper_class; ?>">
159
  <?php foreach ($tags as $key => $tag) { ?>
160
  <div data-id="<?php echo esc_attr( $tag['term_id'] ); ?>" class="is-ajax-search-post">
161
  <span class="is-ajax-term-label"><?php echo esc_html( $term_title ); ?></span>
@@ -195,9 +195,9 @@ class IS_Ajax {
195
  }
196
  $details = ob_get_clean();
197
  if ( $details ) {?>
198
- <div class="<?php echo $wrapper_class; ?>">
199
  <?php
200
- echo $details;
201
  ?>
202
  </div>
203
  <?php }
@@ -389,7 +389,7 @@ class IS_Ajax {
389
  } else if ( isset( $field['show_image'] ) && $field['show_image'] ) { ?>
390
  <div class="left-section">
391
  <div class="thumbnail">
392
- <a href="<?php echo get_the_permalink( $temp_id ); ?>"><?php echo $image; ?></a>
393
  </div>
394
  </div>
395
  <?php }
@@ -468,13 +468,13 @@ class IS_Ajax {
468
  if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
469
  $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
470
  }
471
- $time_string = sprintf( $time_string,
472
  esc_attr( get_the_date( 'c', $post->ID ) ),
473
  esc_html( get_the_date( '', $post->ID ) ),
474
  esc_attr( get_the_modified_date( 'c', $post->ID ) ),
475
  esc_html( get_the_modified_date( '', $post->ID ) )
476
  );
477
- echo $time_string; ?>
478
  </span>
479
  </span>
480
  <?php }
@@ -499,7 +499,7 @@ class IS_Ajax {
499
  <span class="is-meta-tag">
500
  <?php echo sprintf( '<i>%s</i>', __( 'Tagged with:', 'add-search-to-menu' ) ); ?>
501
  <span class="is-tags-links">
502
- <?php foreach ( $terms as $key => $term ) { if ( $key ) { echo ', '; }?><a href="<?php echo get_term_link( $term->term_id, $post->post_type.'_tag' ); ?> " rel="tag"><?php echo $term->name; ?></a><?php } ?>
503
  </span>
504
  </span>
505
  <?php }
@@ -527,7 +527,7 @@ class IS_Ajax {
527
  <span class="is-meta-category">
528
  <?php echo sprintf( '<i>%s</i>', __( 'Categories:', 'add-search-to-menu' ) ); ?>
529
  <span class="is-cat-links">
530
- <?php foreach ( $terms as $key => $term ) { if ( $key ) { echo ', '; } ?><a href="<?php echo get_term_link( $term->term_id, $tax_name ); ?> " rel="tag"><?php echo $term->name; ?></a><?php } ?>
531
  </span>
532
  </span>
533
  <?php }
@@ -575,7 +575,7 @@ class IS_Ajax {
575
  $content = wp_trim_words( $content, $excerpt_length, '...' );
576
  ?>
577
  <div class="is-ajax-result-description">
578
- <?php echo $content; ?>
579
  </div>
580
  <?php
581
  }
@@ -599,7 +599,7 @@ class IS_Ajax {
599
  if( isset( $field['show_stock_status'] ) && $field['show_stock_status'] ) {
600
  $stock_status = ( $product->is_in_stock() ) ? 'in-stock' : 'out-of-stock';
601
  $stock_status_text = ( 'in-stock' == $stock_status ) ? __( 'In stock', 'add-search-to-menu' ) : __( 'Out of stock', 'add-search-to-menu' );
602
- echo '<span class="stock-status is-'.$stock_status.'">'.$stock_status_text.'</span>';
603
  }
604
  }
605
  }
@@ -646,7 +646,7 @@ class IS_Ajax {
646
  if ( $product->is_in_stock() || false === $hide_price_out_of_stock ) {?>
647
  <span class="is-prices">
648
  <?php
649
- echo $product->get_price_html();
650
  ?>
651
  </span>
652
  <?php
91
 
92
  $template = locate_template( 'is-ajax-results.php' );
93
 
94
+ if ( $template ) {
95
+ load_template( $template );
96
+ } else {
97
+ require_once IS_PLUGIN_DIR . 'public/partials/is-ajax-results.php';
98
  }
99
+
 
 
100
  wp_die();
101
  }
102
 
155
  if ( $is_markup ) {
156
  do_action( 'is_term_title_markup', $taxonomy, $search_term, $term_title, $wrapper_class, $tags );
157
  } else if( $tags ) { ?>
158
+ <div class="<?php esc_attr_e( $wrapper_class ); ?>">
159
  <?php foreach ($tags as $key => $tag) { ?>
160
  <div data-id="<?php echo esc_attr( $tag['term_id'] ); ?>" class="is-ajax-search-post">
161
  <span class="is-ajax-term-label"><?php echo esc_html( $term_title ); ?></span>
195
  }
196
  $details = ob_get_clean();
197
  if ( $details ) {?>
198
+ <div class="<?php esc_attr_e( $wrapper_class ); ?>">
199
  <?php
200
+ echo wp_kses_post( $details );
201
  ?>
202
  </div>
203
  <?php }
389
  } else if ( isset( $field['show_image'] ) && $field['show_image'] ) { ?>
390
  <div class="left-section">
391
  <div class="thumbnail">
392
+ <a href="<?php echo get_the_permalink( $temp_id ); ?>"><?php echo wp_kses_post( $image ); ?></a>
393
  </div>
394
  </div>
395
  <?php }
468
  if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
469
  $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
470
  }
471
+ printf( $time_string,
472
  esc_attr( get_the_date( 'c', $post->ID ) ),
473
  esc_html( get_the_date( '', $post->ID ) ),
474
  esc_attr( get_the_modified_date( 'c', $post->ID ) ),
475
  esc_html( get_the_modified_date( '', $post->ID ) )
476
  );
477
+ ?>
478
  </span>
479
  </span>
480
  <?php }
499
  <span class="is-meta-tag">
500
  <?php echo sprintf( '<i>%s</i>', __( 'Tagged with:', 'add-search-to-menu' ) ); ?>
501
  <span class="is-tags-links">
502
+ <?php foreach ( $terms as $key => $term ) { if ( $key ) { echo ', '; }?><a href="<?php echo get_term_link( $term->term_id, $post->post_type.'_tag' ); ?> " rel="tag"><?php esc_html_e( $term->name ); ?></a><?php } ?>
503
  </span>
504
  </span>
505
  <?php }
527
  <span class="is-meta-category">
528
  <?php echo sprintf( '<i>%s</i>', __( 'Categories:', 'add-search-to-menu' ) ); ?>
529
  <span class="is-cat-links">
530
+ <?php foreach ( $terms as $key => $term ) { if ( $key ) { echo ', '; } ?><a href="<?php echo get_term_link( $term->term_id, $tax_name ); ?> " rel="tag"><?php esc_html_e( $term->name ); ?></a><?php } ?>
531
  </span>
532
  </span>
533
  <?php }
575
  $content = wp_trim_words( $content, $excerpt_length, '...' );
576
  ?>
577
  <div class="is-ajax-result-description">
578
+ <?php echo wp_kses_post( $content ); ?>
579
  </div>
580
  <?php
581
  }
599
  if( isset( $field['show_stock_status'] ) && $field['show_stock_status'] ) {
600
  $stock_status = ( $product->is_in_stock() ) ? 'in-stock' : 'out-of-stock';
601
  $stock_status_text = ( 'in-stock' == $stock_status ) ? __( 'In stock', 'add-search-to-menu' ) : __( 'Out of stock', 'add-search-to-menu' );
602
+ echo '<span class="stock-status is-'. esc_attr( $stock_status ).'">'. esc_html($stock_status_text).'</span>';
603
  }
604
  }
605
  }
646
  if ( $product->is_in_stock() || false === $hide_price_out_of_stock ) {?>
647
  <span class="is-prices">
648
  <?php
649
+ echo wp_kses_post( $product->get_price_html() );
650
  ?>
651
  </span>
652
  <?php
public/class-is-public.php CHANGED
@@ -81,10 +81,10 @@ class IS_Public
81
 
82
  if ( is_search() ) {
83
  if ( isset( $_GET['id'] ) ) {
84
- $is_temp['is_id'] = $_GET['id'];
85
  }
86
  if ( isset( $_GET['s'] ) ) {
87
- $is_temp['is_label'] = $_GET['s'];
88
  }
89
 
90
  if ( 0 == $wp_query->found_posts ) {
@@ -195,7 +195,7 @@ class IS_Public
195
 
196
 
197
  if ( $echo ) {
198
- echo $result ;
199
  } else {
200
  return $result;
201
  }
@@ -337,7 +337,7 @@ class IS_Public
337
  $is_id = '';
338
 
339
  if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
340
- $is_id = ( isset( $_POST['id'] ) ? absint( $_POST['id'] ) : '-1' );
341
  } else {
342
  if ( is_admin() || !$query->is_main_query() ) {
343
  return;
@@ -912,10 +912,10 @@ class IS_Public
912
  if ( is_search() ) {
913
  global $wp_query ;
914
  if ( isset( $_GET['id'] ) ) {
915
- $is_temp['is_id'] = $_GET['id'];
916
  }
917
  if ( isset( $_GET['s'] ) ) {
918
- $is_temp['is_label'] = $_GET['s'];
919
  }
920
 
921
  if ( 0 == $wp_query->found_posts ) {
@@ -955,11 +955,15 @@ class IS_Public
955
  }
956
 
957
 
958
- if ( isset( $this->opt['custom_css'] ) && $this->opt['custom_css'] != '' ) {
959
- echo '<style type="text/css" media="screen">' ;
960
- echo '/* Ivory search custom CSS code */' ;
 
 
961
  echo wp_specialchars_decode( esc_html( $this->opt['custom_css'] ), ENT_QUOTES ) ;
962
- echo '</style>' ;
 
 
963
  }
964
 
965
  global $wp_query ;
81
 
82
  if ( is_search() ) {
83
  if ( isset( $_GET['id'] ) ) {
84
+ $is_temp['is_id'] = sanitize_key( $_GET['id'] );
85
  }
86
  if ( isset( $_GET['s'] ) ) {
87
+ $is_temp['is_label'] = sanitize_text_field( $_GET['s'] );
88
  }
89
 
90
  if ( 0 == $wp_query->found_posts ) {
195
 
196
 
197
  if ( $echo ) {
198
+ echo wp_kses_post( $result ) ;
199
  } else {
200
  return $result;
201
  }
337
  $is_id = '';
338
 
339
  if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
340
+ $is_id = ( isset( $_POST['id'] ) ? sanitize_key( absint( $_POST['id'] ) ) : '-1' );
341
  } else {
342
  if ( is_admin() || !$query->is_main_query() ) {
343
  return;
912
  if ( is_search() ) {
913
  global $wp_query ;
914
  if ( isset( $_GET['id'] ) ) {
915
+ $is_temp['is_id'] = sanitize_key( $_GET['id'] );
916
  }
917
  if ( isset( $_GET['s'] ) ) {
918
+ $is_temp['is_label'] = sanitize_text_field( $_GET['s'] );
919
  }
920
 
921
  if ( 0 == $wp_query->found_posts ) {
955
  }
956
 
957
 
958
+ if ( isset( $this->opt['custom_css'] ) && $this->opt['custom_css'] != '' && !preg_match( '#</?\\w+#', $this->opt['custom_css'] ) ) {
959
+ ?>
960
+ <style type="text/css" media="screen">
961
+ /* Ivory search custom CSS code */
962
+ <?php
963
  echo wp_specialchars_decode( esc_html( $this->opt['custom_css'] ), ENT_QUOTES ) ;
964
+ ?>
965
+ </style>
966
+ <?php
967
  }
968
 
969
  global $wp_query ;
public/partials/is-ajax-results.php CHANGED
@@ -133,8 +133,8 @@ if( 1 == $page ) { ?>
133
  $next_page = $page + 1;
134
  $show_more_class = ( isset( $field['show_more_func'] ) && $field['show_more_func'] ) ? 'redirect-tosr' : '';
135
  ?>
136
- <div class="is-show-more-results <?php echo $show_more_class;?>" data-page="<?php echo $next_page; ?>">
137
- <div class="is-show-more-results-text"><?php echo $field['more_result_text'].' <span>('. ( $posts->found_posts - ( $posts_per_page * $page ) ) .')</span>'; ?></div>
138
  <?php
139
  if ( '' === $show_more_class ){
140
  // AAJX Loader.
@@ -148,7 +148,7 @@ if( 1 == $page ) { ?>
148
  </div>
149
  <?php } ?>
150
  <?php if( isset( $field['show_details_box'] ) && $field['show_details_box'] ) { ?>
151
- <div id="is-ajax-search-details-<?php echo $search_post_id; ?>" class="is-ajax-search-details">
152
  <div class="is-ajax-search-items">
153
  <?php
154
  if ( 1 == $page ) {
133
  $next_page = $page + 1;
134
  $show_more_class = ( isset( $field['show_more_func'] ) && $field['show_more_func'] ) ? 'redirect-tosr' : '';
135
  ?>
136
+ <div class="is-show-more-results <?php esc_attr_e( $show_more_class );?>" data-page="<?php echo $next_page; ?>">
137
+ <div class="is-show-more-results-text"><?php echo wp_kses_post( $field['more_result_text'] .' <span>('. ( $posts->found_posts - ( $posts_per_page * $page ) ) .')</span>'); ?></div>
138
  <?php
139
  if ( '' === $show_more_class ){
140
  // AAJX Loader.
148
  </div>
149
  <?php } ?>
150
  <?php if( isset( $field['show_details_box'] ) && $field['show_details_box'] ) { ?>
151
+ <div id="is-ajax-search-details-<?php esc_attr_e( $search_post_id ); ?>" class="is-ajax-search-details">
152
  <div class="is-ajax-search-items">
153
  <?php
154
  if ( 1 == $page ) {
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: search, woocommerce search, image search, ajax search, search shortcode, l
5
  Requires at least: 3.9
6
  Tested up to: 5.8
7
  Requires PHP: 5.2.4
8
- Stable tag: 4.7
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -194,6 +194,9 @@ Yes we do. We try our best to help free users with customisation requests and we
194
 
195
  == Changelog ==
196
 
 
 
 
197
  = 4.7 =
198
  * Fixed - IvoryAjaxVars is not defined error when JS file loading is disabled.
199
  * Fixed - Security issue.
5
  Requires at least: 3.9
6
  Tested up to: 5.8
7
  Requires PHP: 5.2.4
8
+ Stable tag: 4.7.1
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
 
194
 
195
  == Changelog ==
196
 
197
+ = 4.7.1 =
198
+ * Improved - Code quality to adhere to WordPress development standards and improve safety/security.
199
+
200
  = 4.7 =
201
  * Fixed - IvoryAjaxVars is not defined error when JS file loading is disabled.
202
  * Fixed - Security issue.