Version Description
- Added - is_exclude_child filter to exclude child posts of excluded posts from search.
- Fixed - Whole fuzzy matching was not working when text contains special character.
Download this release
Release Info
Developer | vinod dalvi |
Plugin | Ivory Search – WordPress Search Plugin |
Version | 4.4.11 |
Comparing to | |
See all releases |
Code changes from version 4.4.10 to 4.4.11
- add-search-to-menu.php +2 -2
- admin/class-is-settings-fields.php +4 -4
- admin/js/ivory-search-admin.js +66 -0
- languages/add-search-to-menu.pot +9 -3
- public/class-is-public.php +8 -2
- readme.txt +6 -2
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.4.
|
7 |
* Author: Ivory Search
|
8 |
* Author URI: https://ivorysearch.com/
|
9 |
* License: GPL2+
|
@@ -107,7 +107,7 @@ final class Ivory_Search {
|
|
107 |
private function define_constants() {
|
108 |
|
109 |
if ( ! defined( 'IS_VERSION' ) ) {
|
110 |
-
define( 'IS_VERSION', '4.4.
|
111 |
}
|
112 |
if ( ! defined( 'IS_PLUGIN_FILE' ) ) {
|
113 |
define( 'IS_PLUGIN_FILE', __FILE__ );
|
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.4.11
|
7 |
* Author: Ivory Search
|
8 |
* Author URI: https://ivorysearch.com/
|
9 |
* License: GPL2+
|
107 |
private function define_constants() {
|
108 |
|
109 |
if ( ! defined( 'IS_VERSION' ) ) {
|
110 |
+
define( 'IS_VERSION', '4.4.11' );
|
111 |
}
|
112 |
if ( ! defined( 'IS_PLUGIN_FILE' ) ) {
|
113 |
define( 'IS_PLUGIN_FILE', __FILE__ );
|
admin/class-is-settings-fields.php
CHANGED
@@ -365,7 +365,7 @@ class IS_Settings_Fields
|
|
365 |
*/
|
366 |
function header()
|
367 |
{
|
368 |
-
$content = __( 'Select search form to display in site header.', 'add-search-to-menu' );
|
369 |
IS_Help::help_info( $content );
|
370 |
$html = '';
|
371 |
$args = array(
|
@@ -377,7 +377,7 @@ class IS_Settings_Fields
|
|
377 |
if ( !empty($posts) ) {
|
378 |
$check_value = ( isset( $this->opt['header_search'] ) ? $this->opt['header_search'] : 0 );
|
379 |
$html .= '<select class="ivory_search_header" id="is_header_search" name="is_settings[header_search]" >';
|
380 |
-
$html .= '<option value="0" ' . selected( 0, $check_value, false ) . '>' . __( '
|
381 |
foreach ( $posts as $post ) {
|
382 |
$html .= '<option value="' . $post->ID . '"' . selected( $post->ID, $check_value, false ) . ' >' . $post->post_title . '</option>';
|
383 |
}
|
@@ -391,7 +391,7 @@ class IS_Settings_Fields
|
|
391 |
|
392 |
}
|
393 |
|
394 |
-
echo '<div>' . $html . '</div>' ;
|
395 |
}
|
396 |
|
397 |
/**
|
@@ -411,7 +411,7 @@ class IS_Settings_Fields
|
|
411 |
if ( !empty($posts) ) {
|
412 |
$check_value = ( isset( $this->opt['footer_search'] ) ? $this->opt['footer_search'] : 0 );
|
413 |
$html .= '<select class="ivory_search_footer" id="is_footer_search" name="is_settings[footer_search]" >';
|
414 |
-
$html .= '<option value="0" ' . selected( 0, $check_value, false ) . '>' . __( '
|
415 |
foreach ( $posts as $post ) {
|
416 |
$html .= '<option value="' . $post->ID . '"' . selected( $post->ID, $check_value, false ) . ' >' . $post->post_title . '</option>';
|
417 |
}
|
365 |
*/
|
366 |
function header()
|
367 |
{
|
368 |
+
$content = __( 'Select search form to display in site header( Not Menu ).', 'add-search-to-menu' );
|
369 |
IS_Help::help_info( $content );
|
370 |
$html = '';
|
371 |
$args = array(
|
377 |
if ( !empty($posts) ) {
|
378 |
$check_value = ( isset( $this->opt['header_search'] ) ? $this->opt['header_search'] : 0 );
|
379 |
$html .= '<select class="ivory_search_header" id="is_header_search" name="is_settings[header_search]" >';
|
380 |
+
$html .= '<option value="0" ' . selected( 0, $check_value, false ) . '>' . __( 'None', 'add-search-to-menu' ) . '</option>';
|
381 |
foreach ( $posts as $post ) {
|
382 |
$html .= '<option value="' . $post->ID . '"' . selected( $post->ID, $check_value, false ) . ' >' . $post->post_title . '</option>';
|
383 |
}
|
391 |
|
392 |
}
|
393 |
|
394 |
+
echo '<div>' . $html . '<br/><br/><span class="is-help"><span class="is-info-warning">' . __( 'Please note that the above option displays search form in site header and not in navigation menu.', 'add-search-to-menu' ) . '</span></span></div>' ;
|
395 |
}
|
396 |
|
397 |
/**
|
411 |
if ( !empty($posts) ) {
|
412 |
$check_value = ( isset( $this->opt['footer_search'] ) ? $this->opt['footer_search'] : 0 );
|
413 |
$html .= '<select class="ivory_search_footer" id="is_footer_search" name="is_settings[footer_search]" >';
|
414 |
+
$html .= '<option value="0" ' . selected( 0, $check_value, false ) . '>' . __( 'None', 'add-search-to-menu' ) . '</option>';
|
415 |
foreach ( $posts as $post ) {
|
416 |
$html .= '<option value="' . $post->ID . '"' . selected( $post->ID, $check_value, false ) . ' >' . $post->post_title . '</option>';
|
417 |
}
|
admin/js/ivory-search-admin.js
CHANGED
@@ -73,6 +73,14 @@
|
|
73 |
$('.form-table .ui-accordion-content, .form-table .actions a.collapse').show();
|
74 |
$('.form-table .ui-accordion-content').addClass('ui-accordion-content-active');
|
75 |
$('.form-table h3').addClass('ui-state-active');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
76 |
return false;
|
77 |
} );
|
78 |
|
@@ -81,15 +89,73 @@
|
|
81 |
$('.form-table .ui-accordion-content, .form-table .actions a.collapse').hide();
|
82 |
$('.form-table .ui-accordion-content').removeClass('ui-accordion-content-active');
|
83 |
$('.form-table h3').removeClass('ui-state-active');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
return false;
|
85 |
} );
|
86 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
87 |
$( ".form-table" ).accordion( {
|
88 |
collapsible: true,
|
89 |
heightStyle: "content",
|
90 |
icons: false,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
} );
|
92 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
$('#search-body select[multiple] option').mousedown(function(e) {
|
94 |
if ($(this).attr('selected')) {
|
95 |
$(this).removeAttr('selected');
|
73 |
$('.form-table .ui-accordion-content, .form-table .actions a.collapse').show();
|
74 |
$('.form-table .ui-accordion-content').addClass('ui-accordion-content-active');
|
75 |
$('.form-table h3').addClass('ui-state-active');
|
76 |
+
if ( history.pushState ) {
|
77 |
+
var newurl = window.location.href.split('#')[0]+ '#expand';
|
78 |
+
window.history.pushState({path:newurl},'',newurl);
|
79 |
+
$('form input[name="_wp_http_referer"]').val( $('form input[name="_wp_http_referer"]').val().split('#')[0]+ '#expand');
|
80 |
+
if ( $('#is-admin-form-element').length ) {
|
81 |
+
$('#is-admin-form-element').attr( 'action', $('#is-admin-form-element').attr('action').split('#')[0]+ '#expand');
|
82 |
+
}
|
83 |
+
}
|
84 |
return false;
|
85 |
} );
|
86 |
|
89 |
$('.form-table .ui-accordion-content, .form-table .actions a.collapse').hide();
|
90 |
$('.form-table .ui-accordion-content').removeClass('ui-accordion-content-active');
|
91 |
$('.form-table h3').removeClass('ui-state-active');
|
92 |
+
if ( history.pushState ) {
|
93 |
+
var newurl = window.location.href.split('#')[0]+ '#collapse';
|
94 |
+
window.history.pushState({path:newurl},'',newurl);
|
95 |
+
$('form input[name="_wp_http_referer"]').val( $('form input[name="_wp_http_referer"]').val().split('#')[0]+ '#collapse');
|
96 |
+
if ( $('#is-admin-form-element').length ) {
|
97 |
+
$('#is-admin-form-element').attr( 'action', $('#is-admin-form-element').attr('action').split('#')[0]+ '#collapse');
|
98 |
+
}
|
99 |
+
}
|
100 |
return false;
|
101 |
} );
|
102 |
|
103 |
+
var accordion_id = window.location.href.split('#');
|
104 |
+
if ( 2 === accordion_id.length ) {
|
105 |
+
$('form input[name="_wp_http_referer"]').val( $('form input[name="_wp_http_referer"]').val().split('#')[0]+ '#'+accordion_id[1]);
|
106 |
+
if ( $('#is-admin-form-element').length ) {
|
107 |
+
$('#is-admin-form-element').attr( 'action', $('#is-admin-form-element').attr('action').split('#')[0]+ '#'+accordion_id[1]);
|
108 |
+
}
|
109 |
+
}
|
110 |
+
|
111 |
$( ".form-table" ).accordion( {
|
112 |
collapsible: true,
|
113 |
heightStyle: "content",
|
114 |
icons: false,
|
115 |
+
active: false,
|
116 |
+
create: function( event, ui ) {
|
117 |
+
if ( 2 === accordion_id.length ) {
|
118 |
+
var temp_id = accordion_id[1].split('-');
|
119 |
+
if ( 3 === temp_id.length ) {
|
120 |
+
temp_id = ( temp_id[2] / 2 ) - 1;
|
121 |
+
$(".form-table").accordion( "option", "active", temp_id );
|
122 |
+
$('html, body').animate({
|
123 |
+
scrollTop: ( ( $('#'+accordion_id[1]).offset().top ) - 200 )
|
124 |
+
}, 500 );
|
125 |
+
} else {
|
126 |
+
switch( accordion_id[1] ) {
|
127 |
+
case 'expand':
|
128 |
+
$('.form-table .actions a.expand').hide();
|
129 |
+
$('.form-table .ui-accordion-content, .form-table .actions a.collapse').show();
|
130 |
+
$('.form-table .ui-accordion-content').addClass('ui-accordion-content-active');
|
131 |
+
$('.form-table h3').addClass('ui-state-active');
|
132 |
+
break;
|
133 |
+
case 'collapse':
|
134 |
+
$('.form-table .actions a.expand').show();
|
135 |
+
$('.form-table .ui-accordion-content, .form-table .actions a.collapse').hide();
|
136 |
+
$('.form-table .ui-accordion-content').removeClass('ui-accordion-content-active');
|
137 |
+
$('.form-table h3').removeClass('ui-state-active');
|
138 |
+
break;
|
139 |
+
}
|
140 |
+
}
|
141 |
+
} else {
|
142 |
+
$(".form-table").accordion( "option", "active", 0 );
|
143 |
+
}
|
144 |
+
},
|
145 |
} );
|
146 |
|
147 |
+
$('.form-table h3').click( function() {
|
148 |
+
var aria_controls = $( this ).attr('aria-controls');
|
149 |
+
if ( history.pushState ) {
|
150 |
+
var newurl = window.location.href.split('#')[0]+ '#'+aria_controls;
|
151 |
+
window.history.pushState({path:newurl},'',newurl);
|
152 |
+
$('form input[name="_wp_http_referer"]').val( $('form input[name="_wp_http_referer"]').val().split('#')[0]+ '#'+aria_controls );
|
153 |
+
if ( $('#is-admin-form-element').length ) {
|
154 |
+
$('#is-admin-form-element').attr( 'action', $('#is-admin-form-element').attr('action').split('#')[0]+ '#'+aria_controls);
|
155 |
+
}
|
156 |
+
}
|
157 |
+
} );
|
158 |
+
|
159 |
$('#search-body select[multiple] option').mousedown(function(e) {
|
160 |
if ($(this).attr('selected')) {
|
161 |
$(this).removeAttr('selected');
|
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: 2020-06-
|
6 |
"PO-Revision-Date: 2020-03-17 21:05+0530\n"
|
7 |
"Last-Translator: \n"
|
8 |
"Language-Team: Ivory Search <admin@ivorysearch.com>\n"
|
@@ -1284,12 +1284,18 @@ msgid ""
|
|
1284 |
msgstr ""
|
1285 |
|
1286 |
#: ../admin/class-is-settings-fields.php:315
|
1287 |
-
msgid "Select search form to display in site header."
|
1288 |
msgstr ""
|
1289 |
|
1290 |
#: ../admin/class-is-settings-fields.php:327
|
1291 |
#: ../admin/class-is-settings-fields.php:359
|
1292 |
-
msgid "
|
|
|
|
|
|
|
|
|
|
|
|
|
1293 |
msgstr ""
|
1294 |
|
1295 |
#: ../admin/class-is-settings-fields.php:347
|
2 |
msgid ""
|
3 |
msgstr ""
|
4 |
"Project-Id-Version: Ivory Search\n"
|
5 |
+
"POT-Creation-Date: 2020-06-18 14:47+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"
|
1284 |
msgstr ""
|
1285 |
|
1286 |
#: ../admin/class-is-settings-fields.php:315
|
1287 |
+
msgid "Select search form to display in site header( Not Menu )."
|
1288 |
msgstr ""
|
1289 |
|
1290 |
#: ../admin/class-is-settings-fields.php:327
|
1291 |
#: ../admin/class-is-settings-fields.php:359
|
1292 |
+
msgid "None"
|
1293 |
+
msgstr ""
|
1294 |
+
|
1295 |
+
#: ../admin/class-is-settings-fields.php:339
|
1296 |
+
msgid ""
|
1297 |
+
"Please note that the above option displays search form in site header and "
|
1298 |
+
"not in navigation menu."
|
1299 |
msgstr ""
|
1300 |
|
1301 |
#: ../admin/class-is-settings-fields.php:347
|
public/class-is-public.php
CHANGED
@@ -413,9 +413,15 @@ class IS_Public
|
|
413 |
if ( isset( $query->query_vars['_is_excludes']['ignore_sticky_posts'] ) ) {
|
414 |
$values = get_option( 'sticky_posts' );
|
415 |
}
|
|
|
416 |
if ( isset( $query->query_vars['_is_excludes']['post__not_in'] ) ) {
|
417 |
$values = array_merge( $values, array_values( $query->query_vars['_is_excludes']['post__not_in'] ) );
|
|
|
|
|
|
|
|
|
418 |
}
|
|
|
419 |
$query->set( 'post__not_in', $values );
|
420 |
break;
|
421 |
case 'tax_query':
|
@@ -583,8 +589,8 @@ class IS_Public
|
|
583 |
|
584 |
if ( isset( $q['_is_settings']['fuzzy_match'] ) && '2' !== $q['_is_settings']['fuzzy_match'] ) {
|
585 |
$like = 'REGEXP';
|
586 |
-
$f = "(^|[[
|
587 |
-
$l = "([[
|
588 |
}
|
589 |
|
590 |
$searchand = '';
|
413 |
if ( isset( $query->query_vars['_is_excludes']['ignore_sticky_posts'] ) ) {
|
414 |
$values = get_option( 'sticky_posts' );
|
415 |
}
|
416 |
+
|
417 |
if ( isset( $query->query_vars['_is_excludes']['post__not_in'] ) ) {
|
418 |
$values = array_merge( $values, array_values( $query->query_vars['_is_excludes']['post__not_in'] ) );
|
419 |
+
$exclude_child = apply_filters( 'is_exclude_child', false );
|
420 |
+
if ( $exclude_child ) {
|
421 |
+
$query->set( 'post_parent__not_in', $values );
|
422 |
+
}
|
423 |
}
|
424 |
+
|
425 |
$query->set( 'post__not_in', $values );
|
426 |
break;
|
427 |
case 'tax_query':
|
589 |
|
590 |
if ( isset( $q['_is_settings']['fuzzy_match'] ) && '2' !== $q['_is_settings']['fuzzy_match'] ) {
|
591 |
$like = 'REGEXP';
|
592 |
+
$f = "(^|[[\\s|.|~|`|!|@|#|\$|%|^|&|*|(|)|_|\\-|+|=|{|}|[|\\]|\\||:|;|<|>|\\?|\\/|\\|\\]])";
|
593 |
+
$l = "([[\\s|.|~|`|!|@|#|\$|%|^|&|*|(|)|_|\\-|+|=|{|}|[|\\]|\\||:|;|<|>|\\?|\\/|\\|\\]]|\$)";
|
594 |
}
|
595 |
|
596 |
$searchand = '';
|
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.4
|
7 |
Requires PHP: 5.2.4
|
8 |
-
Stable tag: 4.4.
|
9 |
License: GPLv2 or later
|
10 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
@@ -36,7 +36,7 @@ Feel free to ask it using [Contact Form](https://ivorysearch.com/contact/).
|
|
36 |
|
37 |
<ul>
|
38 |
<li> Search WooCommerce products.</li>
|
39 |
-
<li> Search images, files and attachments.</li>
|
40 |
<li> Customize search form using customizer.</li>
|
41 |
<li> Search using AJAX search.</li>
|
42 |
<li> Create unlimited number of search forms.</li>
|
@@ -192,6 +192,10 @@ Yes we do. We try our best to help free users with customisation requests and we
|
|
192 |
|
193 |
== Changelog ==
|
194 |
|
|
|
|
|
|
|
|
|
195 |
= 4.4.10 =
|
196 |
* Added - Plugin option to display search form easy to edit links.
|
197 |
* Added - Plugin option to redirect More Results text to search results page.
|
5 |
Requires at least: 3.9
|
6 |
Tested up to: 5.4
|
7 |
Requires PHP: 5.2.4
|
8 |
+
Stable tag: 4.4.11
|
9 |
License: GPLv2 or later
|
10 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
36 |
|
37 |
<ul>
|
38 |
<li> Search WooCommerce products.</li>
|
39 |
+
<li> Search images, media, files and attachments.</li>
|
40 |
<li> Customize search form using customizer.</li>
|
41 |
<li> Search using AJAX search.</li>
|
42 |
<li> Create unlimited number of search forms.</li>
|
192 |
|
193 |
== Changelog ==
|
194 |
|
195 |
+
= 4.4.11 =
|
196 |
+
* Added - is_exclude_child filter to exclude child posts of excluded posts from search.
|
197 |
+
* Fixed - Whole fuzzy matching was not working when text contains special character.
|
198 |
+
|
199 |
= 4.4.10 =
|
200 |
* Added - Plugin option to display search form easy to edit links.
|
201 |
* Added - Plugin option to redirect More Results text to search results page.
|