﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc	focuses
66281	Taxonomy: Add description to the fields searched by WP_Term_Query / admin term search	abditsori		"`WP_Term_Query::get_search_sql()` hardcodes its `search` matching to
just two columns:

{{{
return $wpdb->prepare( '((t.name LIKE %s) OR (t.slug LIKE %s))', $like, $like );
}}}

A term's `description` (stored on `wp_term_taxonomy`) is never
considered, even though:

- `wp_term_taxonomy` is already unconditionally `INNER JOIN`ed into
  every term query (it's where `taxonomy`, `parent`, and `count` come
  from too), so no new join is required to reach `description`.
- A `description__like` arg already exists for exact-field LIKE
  matching — it's just never combined with `search`.

Because `edit-tags.php?taxonomy=X` is the single shared admin screen
for every taxonomy (Categories, Tags, Link Categories, and any custom
taxonomy with an admin UI all use the same `WP_Terms_List_Table`
class), this affects all of them identically: searching the admin
term list only matches name/slug, never description, with no way to
opt in short of hooking `terms_clauses` and hand-building a `tt.description
LIKE` clause in a plugin.

Steps to reproduce:

1. Create a category (or tag) with a short, generic name but a
   distinctive description, e.g. name ""Misc"", description containing
   the word ""pineapple"".
2. Go to Posts > Categories (or Posts > Tags) in wp-admin.
3. Search for ""pineapple"".

Expected: the term is found, since ""pineapple"" appears in its
description.

Actual: no results — only `name`/`slug` are searched.

Suggested fix: add an opt-in `search_columns` query var to
`WP_Term_Query` (accepting `'name'`, `'slug'`, `'description'`;
default empty array, preserving today's name+slug-only behavior for
every existing caller), and have `get_search_sql()` build its `OR`'d
`LIKE` clause from the configured columns instead of the hardcoded
pair — mirroring the existing `user_search_columns` pattern already
used by `WP_User_Query`. `WP_Terms_List_Table::prepare_items()` then
opts in to all three columns for the admin search box (both the
`get_terms()` call and the `wp_count_terms()` pagination count, so the
displayed total stays consistent with the actual results)."	enhancement	new	normal	Awaiting Review	Taxonomy		normal		has-patch has-unit-tests		
