term_search_min_chars filter-hookWP 4.0.0

Filters the minimum number of characters required to fire a tag search via Ajax.

Usage

add_filter( 'term_search_min_chars', 'wp_kama_term_search_min_chars_filter', 10, 3 );

/**
 * Function for `term_search_min_chars` filter-hook.
 * 
 * @param int         $characters      The minimum number of characters required.
 * @param WP_Taxonomy $taxonomy_object The taxonomy object.
 * @param string      $search          The search term.
 *
 * @return int
 */
function wp_kama_term_search_min_chars_filter( $characters, $taxonomy_object, $search ){

	// filter...
	return $characters;
}
$characters(int)
The minimum number of characters required.
Default: 2
$taxonomy_object(WP_Taxonomy)
The taxonomy object.
$search(string)
The search term.

Changelog

Since 4.0.0 Introduced.

Where the hook is called

wp_ajax_ajax_tag_search()
term_search_min_chars
wp-admin/includes/ajax-actions.php 145
$term_search_min_chars = (int) apply_filters( 'term_search_min_chars', 2, $taxonomy_object, $search );

Where the hook is used in WordPress

Usage not found.