term_search_min_chars хук-фильтрWP 4.0.0

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

Использование

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 $tax        The taxonomy object.
 * @param string      $s          The search term.
 *
 * @return int
 */
function wp_kama_term_search_min_chars_filter( $characters, $tax, $s ){

	// filter...
	return $characters;
}
$characters(int)
The minimum number of characters required.
По умолчанию: 2
$tax(WP_Taxonomy)
The taxonomy object.
$s(строка)
The search term.

Список изменений

С версии 4.0.0 Введена.

Где вызывается хук

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, $tax, $s );

Где используется хук в WordPress

Использование не найдено.