Get terms that contain posts that in turn belong to other terms?

This should get you the names of all such terms in an array $wpdb->get_col(“SELECT DISTINCT {$wpdb->terms}.name FROM {$wpdb->terms} INNER JOIN {$wpdb->term_taxonomy} ON {$wpdb->term_taxonomy}.term_id = {$wpdb->terms}.term_id INNER JOIN {$wpdb->term_relationships} ON {$wpdb->term_taxonomy}.term_taxonomy_id = {$wpdb->term_relationships}.term_taxonomy_id WHERE {$wpdb->term_taxonomy}.taxonomy = ‘shape’ AND {$wpdb->term_relationships}.object_id IN ( SELECT object_id FROM {$wpdb->term_relationships} INNER JOIN {$wpdb->term_taxonomy} ON {$wpdb->term_taxonomy}.term_taxonomy_id = {$wpdb->term_relationships}.term_taxonomy_id WHERE {$wpdb->term_taxonomy}.taxonomy = ‘color’ … Read more

How to display warning on post editor when trying to add new term to custom taxonomy?

Whilst this doesn’t show a warning as you are asking for, you could always hide the “add new” link using the admin_head action: function yourprefix_admin_head() { echo ‘<style> #language-add-toggle { display: none; } </style>’; } add_action(‘admin_head’, ‘yourprefix_admin_head’); The element ID is the taxonomy name followed by -add-toggle. This is enough for most cases, unless you … Read more

Why does a custom post type need the ”hierarchical’ args setting?

When you have two content objects with a similar interface or shared properties, you have a good candidate for hierarchical post types. Take places as an example (see this answer): Asia Europe Germany Berlin Austria Vienna Each place has similar meta data: population, geo coordinates, spoken languages. You just can reuse the same interface. Plus, … Read more

Custom Taxonomy in plugin and template

First of all – plugins are for generating content, themes are for displaying it. So really, a plugin shouldn’t do this. But there are grey areas – for example in an ‘events’ related plugin, it would be desirable to display dates, venue etc – things that a WordPress theme wouldn’t normally display. I would suggest … Read more

Is there a (relatively easy!) way to create relationships between taxonomies WITHOUT needing a post as an intermediary

Using standard WordPress functionalities this is, simply, not possible, unless using complicated and poorly performing tricks. The method I suggest you is to create your custom table where store relationship. It should consists of 5 columns: person_id | post_id | post_type | taxonomy | term_id Now, copying out your example: Person A may be the … Read more