} if ( $values ) { if ( false ===
$wpdb->
query( "INSERT INTO
$wpdb->term_relationships (object_id, term_taxonomy_id, term_order) VALUES " .
implode( ',',
$values ) . ' ON DUPLICATE KEY UPDATE term_order = VALUES(term_order)'
) ) { return new WP_Error( 'db_insert_error',
__( 'Could not insert term relationship into the database.'
),
$wpdb->last_error
);
} } } wp_cache_delete( $object_id,
$taxonomy . '_relationships'
);
wp_cache_set_terms_last_changed();
/**
* Fires after an object's terms have been set.
*
* @since 2.8.0
*
* @param int $object_id Object ID.
* @param array $terms An array of object term IDs or slugs.
* @param array $tt_ids An array of term taxonomy IDs.
* @param string $taxonomy Taxonomy slug.
* @param bool $append Whether to append new terms to the old terms.
* @param array $old_tt_ids Old array of term taxonomy IDs.
*/