Skip to content

Instantly share code, notes, and snippets.

@mgibbs189
Last active January 23, 2019 12:38
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 mgibbs189/3b2ebd8abffab43a8b72672bde721cde to your computer and use it in GitHub Desktop.
Save mgibbs189/3b2ebd8abffab43a8b72672bde721cde to your computer and use it in GitHub Desktop.
FacetWP + Co-authors plus
<?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 );
@yayaenan
Copy link

yayaenan commented Jan 4, 2019

how?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment