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
<?php | |
function wes_update_personnel_notifications() { | |
// set args to query all Personnel posts | |
$args = array( | |
'post_type' => 'personnel', | |
'post_status' => 'any', | |
'posts_per_page' => -1, | |
); | |
$personnel_posts = get_posts( $args ); |
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); |
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_index_row', function( $params, $class ) { | |
if ( 'college_map' == $params['facet_name'] ) { | |
$term_id = (int) $params['term_id']; | |
$location = get_term_meta( $term_id, 'location', true ); | |
$params['facet_value'] = empty( $location ) ? '' : $location['lat']; | |
$params['facet_display_value'] = empty( $location ) ? '' : $location['lng']; | |
} | |
return $params; | |
}, 10, 2 ); |