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
3211       *
3212       * @since 3.1.0
3213       *
3214       * @param int    $parent_term ID of the parent term.
3215       * @param int    $term_id     Term ID.
3216       * @param string $taxonomy    Taxonomy slug.
3217       * @param array  $parsed_args An array of potentially altered update arguments for the given term.
3218       * @param array  $args        Arguments passed to wp_update_term().
3219       */
3220      $parent = (int) apply_filters( 'wp_update_term_parent', $args['parent'], $term_id, $taxonomy, $parsed_args, $args );
3221
3222      // Check for duplicate slug.
3223      $duplicate = get_term_by( 'slug', $slug, $taxonomy );
3224      if ( $duplicate && $duplicate->term_id !== $term_id ) {
3225           // If an empty slug was passed or the parent changed, reset the slug to something unique.
3226           // Otherwise, bail.
3227           if ( $empty_slug || ( $parent !== (int) $term['parent'] ) ) {
3228                $slug = wp_unique_term_slug( $slug, (object) $args );
3229           } else {