WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )
apply_filters( "hook_name", "what_to_filter" )
.Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
Line | Code |
---|---|
1772 | $term_order = 0; |
1773 | $final_tt_ids = wp_get_object_terms($object_id, $taxonomy, array('fields' => 'tt_ids')); |
1774 | foreach ( $tt_ids as $tt_id ) |
1775 | if ( in_array($tt_id, $final_tt_ids) ) |
1776 | $values[] = $wpdb->prepare( "(%d, %d, %d)", $object_id, $tt_id, ++$term_order); |
1777 | if ( $values ) |
1778 | $wpdb->query("INSERT INTO $wpdb->term_relationships (object_id, term_taxonomy_id, term_order) VALUES " . join(',', $values) . " ON DUPLICATE KEY UPDATE term_order = VALUES(term_order)"); |
1779 | } |
1780 |
|
1781 | do_action('set_object_terms', $object_id, $terms, $tt_ids, $taxonomy, $append, $old_tt_ids); |
1782 | return $tt_ids; |
1783 | } |
1784 |
|
1785 | /** |
1786 | * Will make slug unique, if it isn't already. |
1787 | * |
1788 | * The $slug has to be unique global to every taxonomy, meaning that one |
1789 | * taxonomy term can't have a matching slug with another taxonomy term. Each |
1790 | * slug has to be globally unique for every taxonomy. |