search value from wordpress search showing as plugin search value (2 forms page)

Home Forums Product Support Forums Ajax Search Pro for WordPress Support search value from wordpress search showing as plugin search value (2 forms page)

This topic contains 3 replies, has 2 voices, and was last updated by

 
Keymaster
5 years, 5 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #9731

    Participant

    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.

    Attachments:
    You must be logged in to view attached files.
    #9733

    Hi,

    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:

    <input type='search' class='orig' 
      placeholder='<?php echo asp_icl_t( "Search bar placeholder text" . " ($real_id)", w_isset_def($style&#91;'defaultsearchtext'&#93;, '') ); ?>'
      name='phrase' value='<?php if ( !isset($_GET&#91;'search-type'&#93;) ) echo get_search_query(); ?>' 
      autocomplete="off"/>

    to:

    <input type='search' class='orig' 
      placeholder='<?php echo asp_icl_t( "Search bar placeholder text" . " ($real_id)", w_isset_def($style&#91;'defaultsearchtext'&#93;, '') ); ?>'
      name='phrase' value='<?php echo get_search_query(); ?>' 
      autocomplete="off"/>

    Now the phrase should not appear anymore if the staff search is used.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #9735

    Participant

    great and thanks for the fast reply and fix 🙂

    #9736

    Since 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:

    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;
    }

    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.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘search value from wordpress search showing as plugin search value (2 forms page)’ is closed to new replies.