Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: wp_update_term_parent

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
2689       *
2690       * @since 3.1.0
2691       *
2692       * @param int    $parent      ID of the parent term.
2693       * @param int    $term_id     Term ID.
2694       * @param string $taxonomy    Taxonomy slug.
2695       * @param array  $parsed_args An array of potentially altered update arguments for the given term.
2696       * @param array  $args        An array of update arguments for the given term.
2697       */
2698      $parent = apply_filters( 'wp_update_term_parent', $args['parent'], $term_id, $taxonomy, $parsed_args, $args );
2699
2700      // Check for duplicate slug
2701      $duplicate = get_term_by( 'slug', $slug, $taxonomy );
2702      if ( $duplicate && $duplicate->term_id != $term_id ) {
2703           // If an empty slug was passed or the parent changed, reset the slug to something unique.
2704           // Otherwise, bail.
2705           if ( $empty_slug || ( $parent != $term['parent']) ) {
2706                $slug = wp_unique_term_slug($slug, (object) $args);
2707           } else {