Skip to content

Instantly share code, notes, and snippets.

@JayWood
Created March 1, 2019 01:30
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JayWood/b15a41c4e91a0de91b9e32652dbb8d16 to your computer and use it in GitHub Desktop.
Save JayWood/b15a41c4e91a0de91b9e32652dbb8d16 to your computer and use it in GitHub Desktop.
<?php
/**
* Include all non-core taxonomies in the sync request, limiting by publicly queryable.
*
* @param array The list of existing taxonomies.
* @return array The new array list.
*/
function sync_non_core_taxonomies( $taxonomies ) {
$taxes = get_taxonomies();
foreach ( $taxes as $taxonomy ) {
$tax = get_taxonomy( $taxonomy );
if ( $tax->publicly_queryable ) {
$taxonomies[] = $tax->name;
}
}
return $taxonomies;
}
add_filter( 'ep_sync_taxonomies', 'sync_non_core_taxonomies' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment