Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: wp_update_term_data

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
2734       * Filters term data before it is updated in the database.
2735       *
2736       * @since 4.7.0
2737       *
2738       * @param array  $data     Term data to be updated.
2739       * @param int    $term_id  Term ID.
2740       * @param string $taxonomy Taxonomy slug.
2741       * @param array  $args     Arguments passed to wp_update_term().
2742       */
2743      $data = apply_filters( 'wp_update_term_data', $data, $term_id, $taxonomy, $args );
2744
2745      $wpdb->update( $wpdb->terms, $data, compact( 'term_id' ) );
2746      if ( empty($slug) ) {
2747           $slug = sanitize_title($name, $term_id);
2748           $wpdb->update( $wpdb->terms, compact( 'slug' ), compact( 'term_id' ) );
2749      }
2750
2751      /**
2752       * Fires immediately after the given terms are edited.