[wp-hackers] Modify Search Functionality

Nikolay Bachiyski nbachiyski at developer.bg
Tue Jun 21 06:08:07 GMT 2005


ml_wordpress at copperleaf.org wrote:
 > I want to be able to add some columns in a table I've added with a
 > plugin to the standard search. How would I go about doing this? Is there
 > any kind of filter that I can use to modify the query string?
 >
 > Bill

Let us talk in code first:

function modify_search_string($query) {
	$query->set('s', 'baba');
}

add_action('parse_query', 'modify_search_string');

$query is a reference to the WP_Query object whose parse_query is 
called. For details about what can you do with $query see the WP_Query 
code in classes.php (nope, I didn't find WP_Query docs in the codex).

Nikolay


More information about the wp-hackers mailing list