Forums › Forums › Search & Filter Pro › Problems after upgrade, where is search-filter.php file or code
Tagged: upgrade issue
- This topic has 8 replies, 2 voices, and was last updated 6 years, 8 months ago by Ross.
-
Anonymous(Private) January 29, 2018 at 12:32 pm #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 HoekmeijerRoss Moderator(Private) January 29, 2018 at 1:27 pm #155627Hi 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(Private) January 30, 2018 at 9:16 am #155930Hi,
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 1312It 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
BorisRoss Moderator(Private) February 1, 2018 at 2:56 pm #156768Hi 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 assf-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 functionget_field
)Thanks
Anonymous(Private) February 6, 2018 at 12:52 pm #157704Hi,
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(Private) February 6, 2018 at 2:12 pm #157719I’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
-
AuthorPosts