Skip to content

Instantly share code, notes, and snippets.

@djrmom
Last active December 12, 2017 18:55
Show Gist options
  • Save djrmom/1ede830adaf29dfbd693783166e9b5c6 to your computer and use it in GitHub Desktop.
Save djrmom/1ede830adaf29dfbd693783166e9b5c6 to your computer and use it in GitHub Desktop.
facetwp change author display
<?php
// re-index your facets after adding this code
add_filter( 'facetwp_index_row', function( $params, $class ) {
if ( 'author' == $params['facet_name'] ) {
$user = get_user_by( 'login', $params['facet_display_value'] );
if ( false !== $user ) {
$params['facet_display_value'] = $user->last_name . ', ' . $user->first_name
}
}
return $params;
}, 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment