Last active
January 23, 2019 12:38
-
-
Save mgibbs189/3b2ebd8abffab43a8b72672bde721cde to your computer and use it in GitHub Desktop.
FacetWP + Co-authors plus
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 the following to your (child) theme's functions.php | |
add_filter( 'facetwp_facet_sources', function( $sources ) { | |
if ( class_exists( 'coauthors_plus') && isset( $sources['taxonomies']['choices']['tax/author'] ) ) { | |
$sources['co_authors'] = array( | |
'label' => __( 'Co-Authors', 'co-authors-plus-for-facetwp' ), | |
'choices' => array( | |
'tax/author' => __( 'Authors', 'co-authors-plus-for-facetwp' ), | |
) | |
); | |
unset( $sources['taxonomies']['choices']['tax/author'] ); // remove the duplicate | |
} | |
return $sources; | |
}, 10 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
how?