Hi,
I’m trying to figure out how to change the label ‘Near’ and placeholder text ‘Location’ in the filter bar
I have followed these instructions:
Same Title and Placeholder Terms
which works perfectly for the Search label and placeholder text. So I tried to duplicate and rename the function to get the same result for Location but this doesn’t give me the desired effect.
— this code is the original snippet which my adjustments
add_filter( 'tribe-events-bar-filters', 'tribe_support_1043887', 1, 1 );
function tribe_support_1043887( $filters ) {
$value = '';
if ( ! empty( $_REQUEST['tribe-bar-geoloc'] ) ) {
$value = esc_attr( $_REQUEST['tribe-bar-geoloc'] );
}
$html = sprintf(
'<input type="text" name="tribe-bar-geoloc" id="tribe-bar-geoloc" value="%s" placeholder="%s">',
esc_attr( $value ),
'Placeholder text'
);
$filters['tribe-bar-geoloc']['caption'] = 'Label text';
$filters['tribe-bar-geoloc']['html'] = $html;
return $filters;
}
How to go about this? Thanks in advance!
-
This topic was modified 9 years, 7 months ago by
K..