Created
January 10, 2017 15:42
-
-
Save zreese/ac96355a8b0fd79765e05360b43c09aa to your computer and use it in GitHub Desktop.
Change Name of Wordpress Search Form
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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