WordPress filter hook · part of WordPress core

term_search_min_chars

A WordPress core filter that 9 plugins also fire themselves, running on 77K+ sites between them.

“This filter has been defined in /wp-admin/includes/ajax-actions.php”

How to use term_search_min_chars

It's a filter: your callback receives the value and 2 more arguments, and must return the (changed) value. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_filter( 'term_search_min_chars', function( $value, $tax, $search_term ) {
	// Change $value here.
	return $value;
}, 10, 3 );

Argument names come from WebberZone Top 10's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

This hook is fired by WordPress core too. Official reference on developer.wordpress.org →

9 plugins that fire term_search_min_chars

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. Contextual Related Posts icon Contextual Related Posts50,000+ installs apply_filters( 'term_search_min_chars', 2, $tax, $s ) includes/admin/class-settings.php:2389
  2. WebberZone Top 10 icon WebberZone Top 1010,000+ installs apply_filters( 'term_search_min_chars', 2, $tax, $search_term ) includes/admin/class-settings.php:2222
  3. Shortcake (Shortcode UI) icon Shortcake (Shortcode UI)10,000+ installs apply_filters( 'term_search_min_chars', 2, $taxonomy_type, $search ) inc/fields/class-shortcode-ui-field-term-select.php:152
  4. Better Search icon Better Search5,000+ installs apply_filters( 'term_search_min_chars', 2, $tax, $search_term ) includes/admin/class-settings.php:1944
  5. WebberZone Snippetz icon WebberZone Snippetz1,000+ installs apply_filters( 'term_search_min_chars', 2, $tax, $search_term ) includes/admin/class-settings.php:1355
  6. WZ Followed Posts icon WZ Followed Posts300+ installs apply_filters( 'term_search_min_chars', 2, $tax, $search_term ) includes/admin/class-settings.php:1216
  7. Auto-Close Comments, Pingbacks and Trackbacks icon Auto-Close Comments, Pingbacks and Trackbacks200+ installs apply_filters( 'term_search_min_chars', 2, null, $search_term ) includes/admin/class-settings.php:919
  8. Knowledge Base icon Knowledge Base90+ installs apply_filters( 'term_search_min_chars', 2, $tax, $term ) includes/admin/class-settings.php:230
  9. MyStyle Custom Product Designer icon MyStyle Custom Product Designer60+ installs apply_filters( 'term_search_min_chars', 2, $tax, $s ) includes/class-mystyle-ajax.php:121

Need a customisation built on this hook?

Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.