Created
February 13, 2015 11:47
-
-
Save luistinygod/0d49b2b0f530f6c6fce1 to your computer and use it in GitHub Desktop.
GravityView: How to change the Search Entries label on the Search Widget
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 | |
/* | |
* Supported on GravityView 1.6 | |
* | |
* Add this to your theme's functions.php file | |
* | |
* Replace the string 'MY NEW LABEL' for your own | |
*/ | |
add_filter( 'gravityview_widget_search_filters', 'my_gv_change_search_filters', 10, 2 ); | |
function my_gv_change_search_filters( $search_fields = array(), $instance ) { | |
foreach( $search_fields as $k => $field ) { | |
if( !empty( $field['key'] ) && 'search_all' === $field['key'] ) { | |
$search_fields[ $k ]['label'] = 'MY NEW LABEL'; | |
break; | |
} | |
} | |
return $search_fields; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment