Skip to content

Instantly share code, notes, and snippets.

@zreese
Created January 10, 2017 15:42
Show Gist options
  • Save zreese/ac96355a8b0fd79765e05360b43c09aa to your computer and use it in GitHub Desktop.
Save zreese/ac96355a8b0fd79765e05360b43c09aa to your computer and use it in GitHub Desktop.
Change Name of Wordpress Search Form
/**
* Change the name of the search form from s to fwp_resource_search
*/
function my_query_vars( $public_query_vars ) {
if ( isset( $_GET['fwp_resource_search'] ) && ! empty( $_GET['fwp_resource_search'] ) ) {
$_GET['s'] = $_GET['fwp_resource_search'];
}
return $public_query_vars;
}
add_filter( 'query_vars', 'my_query_vars' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment