Welcome, visitor! Log in
 

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.

  • Action hooks look like this: do_action( "hook_name" )
  • Filter hooks look like this: 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.

Source View

Line Code
3344       *
3345       * @since 3.1.0
3346       *
3347       * @param int    $parent      ID of the parent term.
3348       * @param int    $term_id     Term ID.
3349       * @param string $taxonomy    Taxonomy slug.
3350       * @param array  $parsed_args An array of potentially altered update arguments for the given term.
3351       * @param array  $args        An array of update arguments for the given term.
3352       */
3353      $parent = apply_filters( 'wp_update_term_parent', $args['parent'], $term_id, $taxonomy, $parsed_args, $args );
3354
3355      // Check for duplicate slug
3356      $id = $wpdb->get_var( $wpdb->prepare( "SELECT term_id FROM $wpdb->terms WHERE slug = %s", $slug ) );
3357      if ( $id && ($id != $term_id) ) {
3358           // If an empty slug was passed or the parent changed, reset the slug to something unique.
3359           // Otherwise, bail.
3360           if ( $empty_slug || ( $parent != $term['parent']) )
3361                $slug = wp_unique_term_slug($slug, (object) $args);
3362           else