Created
January 12, 2015 19:04
-
-
Save luistinygod/e2bc8a6c88b207c4ead4 to your computer and use it in GitHub Desktop.
Adds a 'clear' button to your GravityView Search Bar
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
<?php | |
/* Add this to your theme's functions.php file */ | |
// Adds a 'clear' button to your GravityView Search Bar | |
add_action( 'gravityview_search_widget_fields_after', 'my_gv_clear_search_button' ); | |
function my_gv_clear_search_button() { | |
$url = strtok( add_query_arg( array() ), '?' ); | |
?> | |
<a href="<?php echo esc_url( $url ); ?>" class="button gv-search-button">Clear</a> | |
<?php | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment