Last active
October 31, 2022 20:11
-
-
Save nickpish/34ee4db7bfedc25e9de38b2976d9876d to your computer and use it in GitHub Desktop.
Add label element to fSelect facet markup
This file contains hidden or 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
add_filter( 'facetwp_facet_html', function( $output, $params ) { | |
if ( 'fselect' == $params['facet']['type'] ) { | |
$label = '<label for="' . $params['facet']['name'] . '" class="sr-only">Please select a ' . $params['facet']['label'] . '</label>'; | |
$output = $label . $output; | |
} | |
return $output; | |
}, 10, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment