wp_insert_term_data filter-hookWP 4.7.0

Filters term data before it is inserted into the database.

Usage

add_filter( 'wp_insert_term_data', 'wp_kama_insert_term_data_filter', 10, 3 );

/**
 * Function for `wp_insert_term_data` filter-hook.
 * 
 * @param array  $data     Term data to be inserted.
 * @param string $taxonomy Taxonomy slug.
 * @param array  $args     Arguments passed to wp_insert_term().
 *
 * @return array
 */
function wp_kama_insert_term_data_filter( $data, $taxonomy, $args ){

	// filter...
	return $data;
}
$data(array)
Term data to be inserted.
$taxonomy(string)
Taxonomy slug.
$args(array)
Arguments passed to wp_insert_term().

Changelog

Since 4.7.0 Introduced.

Where the hook is called

wp_insert_term()
wp_insert_term_data
wp-includes/taxonomy.php 2495
$data = apply_filters( 'wp_insert_term_data', $data, $taxonomy, $args );

Where the hook is used in WordPress

Usage not found.