- This topic has 3 replies, 2 voices, and was last updated 8 years, 1 month ago by Ernest Marcinko.
-
AuthorPosts
-
August 10, 2016 at 7:32 pm #9731gab1982Participant
Hi I have implemented your pro search plugin and its great however I am trying to use this in conjunction with a custom wordpress search (people search), if I type a value into the people search area then press enter, the value I typed into the people search area appears as the value for your plugin, I have attached a screenshot for you alternatively you can see for yourself:
http://www.bbdimension.com/files/wp6/?search-type=people&s=test&submit=Search
I can’t work out what the issue is.
Please let me know, thank you.
August 10, 2016 at 7:43 pm #9733Ernest MarcinkoKeymasterHi,
It’s not an issue, it’s an intended behavior, because the search query variable “s” is set, which is globally used, so ajax search pro recognizes and prints it as expected. You can see it in the URL as well: &s=test
Since you provided FTP details, I’ve made a quick modification to recognize the people search. I’ve changed the wp-content\plugins\ajax-search-pro\includes\views\asp.shortcode.probox.php file lines 78-81, which is:
[html]<input type=’search’ class=’orig’
placeholder='<?php echo asp_icl_t( "Search bar placeholder text" . " ($real_id)", w_isset_def($style[’defaultsearchtext’], ”) ); ?>’
name=’phrase’ value='<?php if ( !isset($_GET[’search-type’]) ) echo get_search_query(); ?>’
autocomplete="off"/>[/html]to:
[html]<input type=’search’ class=’orig’
placeholder='<?php echo asp_icl_t( "Search bar placeholder text" . " ($real_id)", w_isset_def($style[’defaultsearchtext’], ”) ); ?>’
name=’phrase’ value='<?php echo get_search_query(); ?>’
autocomplete="off"/>[/html]Now the phrase should not appear anymore if the staff search is used.
August 10, 2016 at 7:47 pm #9735gab1982Participantgreat and thanks for the fast reply and fix 🙂
August 10, 2016 at 7:57 pm #9736Ernest MarcinkoKeymasterSince this code will be overwritten in case of an update, I’m adding a way to resolve this in the upcoming release. In case you update in the future, just put this code to the functions.php file in your active theme directory:
[php]add_filter(‘asp_print_search_query’, ‘asp_change_query_cond’, 1, 1);
function asp_change_query_cond( $q ) {
if ( isset($_GET[‘search-type’]) )
return "";
return $q;
}[/php]—
If you don’t mind, I will close this topic and mark it as resolved for now, feel free to open another one if you have other issues.
If you like the plugin, feel free to rate it on your codecanyon downloads page, it’s greatly appreciated.
-
AuthorPosts
- The topic ‘search value from wordpress search showing as plugin search value (2 forms page)’ is closed to new replies.