function set_object_terms($object_id, $terms, $tt_ids, $taxonomy, $append, $old_tt_ids) { if ('category' == $taxonomy && WPT_Production::post_type_name == get_post_type($object_id)) { $production = new WPT_Production($object_id); $events = $production->events(); $categories = wp_get_post_categories($object_id); foreach ($events as $event) { wp_set_post_categories($event->ID, $categories); } } }