Skip to content

Instantly share code, notes, and snippets.

@billerickson
Last active March 5, 2019 22:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save billerickson/6a3bb1a8d08af48f9a90b6a455167ef9 to your computer and use it in GitHub Desktop.
Save billerickson/6a3bb1a8d08af48f9a90b6a455167ef9 to your computer and use it in GitHub Desktop.
<?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