Skip to content

Instantly share code, notes, and snippets.

@guillaumemolter
Last active February 24, 2019 13:33
Show Gist options
  • Save guillaumemolter/737c764512f9a40a821818ae5aa54634 to your computer and use it in GitHub Desktop.
Save guillaumemolter/737c764512f9a40a821818ae5aa54634 to your computer and use it in GitHub Desktop.
Adding multisite taxonomy support to custom post types.
<?php
add_filter( 'hsph_plugin_tagging_topics_post_types', 'cchange_register_cpt_for_tagging' );
add_filter( 'hsph_plugin_tagging_cchange_issues_post_types', 'cchange_register_cpt_for_tagging' );
add_filter( 'hsph_plugin_tagging_cchange_subtopics_post_types', 'cchange_register_cpt_for_tagging' );
function cchange_register_cpt_for_tagging( $post_types = array() ) {
// Array of custom post types.
$cutom_post_types = array( 'cchange_article', 'cchange_issue', 'cchange_subtopic', 'cchange_bio', 'cchange_class', 'cchange_event' );
// Merging default post types and custom post types.
$post_types = array_merge( $post_types, $cutom_post_types );
return $post_types;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment