pre_insert_term filter-hookWP 3.0.0

Filters a term before it is sanitized and inserted into the database.

Usage

add_filter( 'pre_insert_term', 'wp_kama_pre_insert_term_filter', 10, 2 );

/**
 * Function for `pre_insert_term` filter-hook.
 * 
 * @param string|WP_Error $term     The term name to add, or a WP_Error object if there's an error.
 * @param string          $taxonomy Taxonomy slug.
 *
 * @return string|WP_Error
 */
function wp_kama_pre_insert_term_filter( $term, $taxonomy ){

	// filter...
	return $term;
}
$term(string|WP_Error)
The term name to add, or a WP_Error object if there's an error.
$taxonomy(string)
Taxonomy slug.

Changelog

Since 3.0.0 Introduced.

Where the hook is called

wp_insert_term()
pre_insert_term
wp-includes/taxonomy.php 2353
$term = apply_filters( 'pre_insert_term', $term, $taxonomy );

Where the hook is used in WordPress

Usage not found.