Forums Forums Search & Filter Pro Problems after upgrade, where is search-filter.php file or code

Tagged: 

Viewing 9 posts - 1 through 9 (of 9 total)
  • Anonymous
    #155613

    I’ve been using S&F pro 1.4.3 for a long time. It contains some customizations I made at the time, with your help, to search-filter.php and templates/results.php.

    After the upgrade, the search-filter.php file no longer exists, and I cannot find where the code was that I customized in the 1.4.3 version.
    Can you tell me where this code is now:
    $taxonomychildren = get_categories($args);

    if($types[$i]==”select”)
    {
    $returnvar .= $this->generate_wp_dropdown($args, $taxonomy, $this->tagid, $taxonomydata->labels);
    }
    else if($types[$i]==”checkbox”)
    {
    $args[‘title_li’] = ”;
    $args[‘defaults’] = “”;
    $args[‘exclude’] = “1,3”;
    if(isset($this->defaults[$args[‘name’]]))
    {
    $args[‘defaults’] = $this->defaults[$args[‘name’]];
    }
    //$args[‘show_option_all’] = 0;

    $returnvar .= $this->generate_wp_checkbox($args, $taxonomy, $this->tagid, $taxonomydata->labels);
    }
    It used to be in search-filter.php on line 1376.
    Regards,
    Boris Hoekmeijer

    Ross Moderator
    #155627

    Hi Boris

    This was changed several versions ago, and that code has been rewritten I believe (and spread out over multiple files now).

    What exactly are you trying to do? It looks somewhat like you are trying to change the output of our fields?

    We have a filter for doing this now (so you can make changes in your theme, rather than plugin) – https://www.designsandcode.com/documentation/search-filter-pro/action-filter-reference/#Filter_Input_Object

    But again, I’m unsure the purpose of your code so may not be the best advice.

    If you can explain what you are trying to do (again) then I can advise which file to modify or to use our filter.

    Thanks

    Anonymous
    #155930

    Hi,
    I made several changes. In the one I entered above, I added
    $args[‘exclude’] = “1,3”; on lines 1376 and 1450, to exclude certain categories from the search.

    I also added some classes to specific items, so they could be styled properly:
    – class “searchbox” to a list item on line 1099
    – class “search-button” to a list item on line 1138
    – class “search-tag to a list item on line 1312

    It would be great if I could add all these changes using filters, instead of php file customizations. That would save me the trouble of changes the files again after each update!

    Thanks
    Boris

    Anonymous
    #156212

    Hi,
    any news? I would like to wrap this up.
    Thanks!
    Boris

    Ross Moderator
    #156768

    Hi Boris

    Yes, well it looks like you don’t even need our filter for your needs.

    If you want to exclude options from your field, simply hit “advanced” (in S&F admin, search form UI) and there you can enter the IDs you wish to exclude.

    The classes, hmm, we added a filter to change the classes on the input objects (<input>) but not on the containing <li>.

    However, since the version you used, you will notice, we have now added our own classes on to all the <li>, with appropriate names, such as sf-field-search on the search box – take a look at the the source code we generate now – its much better than before.

    I think its better you update your CSS to use our class names… Otherwise you will need to make changes in the files:
    public/includes/class-search-filter-generate-input.php
    public/includes/class-search-filter-display-shortcode.php (look for function get_field)

    Thanks

    Anonymous
    #157704

    Hi,
    allright, that sounds very good. The less I need to customize within the plugin files itself, the better.

    I updated to 2.4.0 now, but strangely enough, the search results are always zero now. There are two posts that should appear in the default view as well as the search.

    As soon as I put back version 1.4.3, the 2 posts appear again. What could be going wrong here?

    Ross Moderator
    #157719

    I’m not 100% sure, I have a similar issue with another person I am trying to fix at the moment.

    Once I fix that, you can try my fixes/modifications (should be later on today).

    Are you able to set up a staging site also so we can work in a safe environment to debug this issue?

    Thanks

    Anonymous
    #159585

    Hi,

    No, I’ve only got the live environment. But traffic is very low, so we can try some things, no problem.

    Any news yet?

    Regards,
    Boris

    Ross Moderator
    #165017
    This reply has been marked as private.
Viewing 9 posts - 1 through 9 (of 9 total)