Last active
August 20, 2019 15:31
-
-
Save mgibbs189/09f2215440edacacdcacfed0f7918c66 to your computer and use it in GitHub Desktop.
Custom sort box (radio) -- event handlers not included
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_filter( 'facetwp_sort_html', function( $html, $params ) { | |
$html = '<div class="facetwp-sort-radio">'; | |
foreach ( $params['sort_options'] as $key => $atts ) { | |
$html .= '<input type="radio" value="' . esc_attr( $key ) . '" /><label>' . esc_html( $atts['label'] ) . '</label>'; | |
} | |
$html .= '</div>'; | |
return $html; | |
}, 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment