WP Manifestindependent plugin directory
manifest / admin / cinq-wp-admin-taxonomy-search

CINQ Admin Taxonomy Search

WordPress plugin: search field in the hierarchical taxonomy boxes of the classic edit screen. No settings.

★ 0stars

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/agencecinq/cinq-wp-admin-taxonomy-search/archive/refs/heads/main.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

WordPress plugin that adds a search field to the hierarchical taxonomy boxes of the post edit screen, such as Categories. No settings screen.

WordPress shows a hierarchical taxonomy as a checklist. The block editor filters it with a search field, from 8 terms; the classic edit screen has none, and with a few hundred terms, finding one means scrolling the box. This plugin adds that field to the classic edit screen and nothing else: the terms stay the core checkboxes, saved by WordPress.

Repository: agencecinq/cinq-wp-admin-taxonomy-search

Requirements

  • WordPress 6.0+
  • PHP 8.1+

Lint (WordPress Coding Standards)

composer install
composer lint          # phpcs
composer lint:fix     # phpcbf (auto-fix)

Use ./vendor/bin/phpcs, not the global phpcs binary — the global install does not register the WordPress standards.

Install

Copy the folder to wp-content/plugins/cinq-wp-admin-taxonomy-search and activate CINQ Admin Taxonomy Search in the WordPress admin, or with WP-CLI:

wp plugin activate cinq-wp-admin-taxonomy-search

To load it on every request without activation, copy the plugin file into mu-plugins. It is then listed under Plugins → Must-Use.

cp cinq-wp-admin-taxonomy-search.php /path/to/wp-content/mu-plugins/

Translations

French is included in languages/. The plugin does not load translations itself: WordPress loads them from its languages folder, which also works when the plugin is a must-use plugin.

Copy both French files to wp-content/languages/plugins/:

  • cinq-wp-admin-taxonomy-search-fr_FR.l10n.php, read by WordPress 6.5 and later;
  • cinq-wp-admin-taxonomy-search-fr_FR.mo, for earlier versions.

To update them after changing a string:

wp i18n make-pot . languages/cinq-wp-admin-taxonomy-search.pot --exclude=vendor
msgmerge --update --backup=none languages/cinq-wp-admin-taxonomy-search-fr_FR.po languages/cinq-wp-admin-taxonomy-search.pot
# Translate the new strings in the .po file, then:
msgfmt -o languages/cinq-wp-admin-taxonomy-search-fr_FR.mo languages/cinq-wp-admin-taxonomy-search-fr_FR.po
wp i18n make-php languages

wp i18n make-php needs WP-CLI 2.8 or later.

Behaviour

The field sits at the top of the box, labelled with the search_items label of the taxonomy, such as “Search Categories”, as in the block editor. It shows from 8 terms, as in the block editor too, and appears when a term added from the box brings it to 8. Typing filters the terms of the box:

  • the search ignores case, accents and the kind of dash, as in the block editor: “editions” finds “Éditions”, “shonen” finds “Shōnen”, “2020-2021” finds “2020–2021”;
  • a term shows with its parents and its children: a child term under its parent, a parent with all its children, where the block editor only shows the children that match;
  • both tabs are filtered, all the terms and the most used ones;
  • a checked term hidden by the search stays checked and is saved with the post;
  • Enter does not submit the post form;
  • when no term matches, the box shows the not_found label of the taxonomy, such as “No categories found.”, where the block editor shows an empty list;
  • a term added from the box shows even when it does not match the search: it is checked, and the next keystroke filters it with the others;
  • screen readers hear the number of terms found, half a second after typing stops, through wp.a11y.speak(); emptying the field announces the number of terms, as in the block editor.

The script adds the field: without JavaScript, the box stays the core one.

Optional filter

// Taxonomies whose box gets the search field (default: every hierarchical taxonomy of the post type shown in the admin).
add_filter(
    'cinq_wp_admin_taxonomy_search_taxonomies',
    fn ( array $taxonomies ) => array_diff( $taxonomies, array( 'category' ) )
);

The filter also gets the post type of the edit screen as its second argument.

Scope

  • Screens: the classic post edit screen, post.php and post-new.php
  • Taxonomies: every hierarchical taxonomy shown as a checklist, more or fewer through cinq_wp_admin_taxonomy_search_taxonomies. A taxonomy whose box is replaced through meta_box_cb, such as a tag box, gets no field.
  • No options, no admin UI beyond the field, no front-end output

License

MIT © CINQ