Is there a way for searchfields to default to the ones set in Admin?

I don't use the searchfields icon in my theme. I'd like for all searches to use the searchfields set in the Zenphoto admin.

Currently, searches made on the tag pages default to only searching the "tag" field. I'm assuming I might have to rewrite the allowedSearchFields() function and put it in my functions.php file. Does anyone know how I can modify this function to always return the searchfields set in the Zenphoto admin?

`
function allowedSearchFields() {
$setlist = array();
$fields = getOption('search_fields');
if (is_numeric($fields)) {
$setlist = $this->numericFields($fields);
} else {
$list = explode(',',$fields);
foreach ($this->search_structure as $key=>$display) {
if (in_array($key,$list)) {
$setlist[$key] = $display;
}
}
}
return $setlist;
}
`
This post is related to my initial report on trac: http://www.zenphoto.org/trac/ticket/1339

Comments

  • And as well, anyone can read the response to that ticket. But bottom line is that you can set the search fields to whatever default you want by just passing the appropriate parameter printSearchForm function. But then, of course, you would have to read the function definition to know that.
  • Ah, never noticed the query_fields option for printSearchForm. Thanks!
Sign In or Register to comment.