-
-
Save billerickson/6a3bb1a8d08af48f9a90b6a455167ef9 to your computer and use it in GitHub Desktop.
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 | |
/** | |
* FacetWP, singular name for post types | |
* | |
*/ | |
add_filter( 'facetwp_index_row', function( $params, $class ) { | |
if ( 'filter_by_type' == $params['facet_name'] ) { | |
$labels = array( | |
'Pages' => 'Page', | |
'Cases' => 'Case', | |
'News' => 'News Post', | |
'Press Releases' => 'Press Release', | |
'Media' => 'Document', | |
); | |
if( array_key_exists( $params['facet_display_value'], $labels ) ) | |
$params['facet_display_value'] = $labels[ $params['facet_display_value'] ]; | |
} | |
return $params; | |
}, 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment