Skip to content

Instantly share code, notes, and snippets.

@kovshenin
Created June 20, 2012 12:44
Show Gist options
  • Save kovshenin/2959721 to your computer and use it in GitHub Desktop.
Save kovshenin/2959721 to your computer and use it in GitHub Desktop.
<?php
add_action( 'pre_get_posts', 'my_pre_get_posts' );
function my_pre_get_posts( $query ) {
if ( ! $query->is_main_query() )
return;
$woo_search = woo_dynamic_search_header();
if ( isset( $woo_search['query_args'] ) )
foreach ( $woo_search['query_args'] as $key => $value )
$query->set( $key, $value );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment