Skip to content

Instantly share code, notes, and snippets.

@djrmom
Created May 10, 2018 23:50
Show Gist options
  • Select an option

  • Save djrmom/fad7778420839d759efa7187023271a6 to your computer and use it in GitHub Desktop.

Select an option

Save djrmom/fad7778420839d759efa7187023271a6 to your computer and use it in GitHub Desktop.
facetwp replace date picker placeholder text
<?php
/** replace the "Date" or "Start Date" or "End Date" text in the datepicker
** Other langauges may have different text to replace as well
**/
add_filter( 'facetwp_facet_html', function( $output, $params ) {
if ( 'my_date_facet' == $params['facet']['name'] ) { // change 'my_date_facet' to the name of your date picker facet
$output = str_replace( 'placeholder="Date"', 'placeholder="mm/dd/yyyy"', $output );
}
return $output;
}, 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment