Let’s say I have several custom post types that all have support for post tags. Since these custom post types will all be tagged with mostly the same keywords, I’d like to know if there is a way to share the commonly used tags between the custom post types.
So if I were to browse a post edit screen for Custom Post Type 1, it would also show Custom Post Type 2 tags inside the metabox. This would be a time-saver.
When you register_taxonomy you can simply add an array of post_types to
$object_type
parameter.From WordPress-codex:
So you can just add an array of post_types after you run
register_taxonomy
and its name in this case “genre”.See code below:
Then you share the same data on dose
post_types
.