WordPress plugin intelligence profile

Taxonomy Thumbnail

Add a thumbnail to your taxonomy terms.

WP PlugIndex snapshot

Current directory snapshot

Tested up to WordPress 4.5
Current version1.3
WordPress coverageTested up to WordPress 4.5
Minimum stackWP 3.5 · PHP —
Directory statusactive
Last directory update30 May 201610y ago
Active installations3K+Adoption metric — not a quality score
WordPress.org rating5.0 / 5 from 10 ratings
Official packageDirect from WordPress.org

Repository metrics are context, not quality scores. Active installations measure adoption and can strongly reflect a plugin’s age and historical popularity. Ratings, recent updates and “Tested up to” metadata also do not guarantee modern code, error-free operation, security, feature completeness or suitability for a particular site. Why active installs don’t tell the whole story →

WP PlugIndex currently records Taxonomy Thumbnail version 1.3 as active, updated 10y ago and tested up to WordPress 4.5.

Overview

About this plugin

This plugin is meant for developers, it allows to attach a thumbnail to taxonomy terms.

UI for setting the thumbnails

The thumbnail can be added on term creation or later on the term edition page.

The terms list has a column displaying the current thumbnail (so far, no specific action here).

5), not the old thickbox.

I made some extra efforts to enhance accessibility. I’m not an a11y expert but the UI is not only a “Add thumbnail” button. speak() is used when available.

Please give me feedback if you think it can be improved.

Works with or without JavaScript.

If JavaScript is enabled, thumbnails are set via ajax in the term edition window, no need to update the term.

By default, the UI is displayed for all public taxonomies, but this can be filtered that way:

add_filter( 'sftth_taxonomies', 'my_taxonomies_with_thumbnail' );

function my_taxonomies_with_thumbnail( $taxonomies ) { unset( $taxonomies['post_tag'] ); $taxonomies['my_custom_tax'] = 'my_custom_tax'; return $taxonomies; }

Template tags

php.

4+, these functions use term_id. 4, they use term_taxonomy_id.

I tried to mimic the post thumbnail functions:

  • get_term_thumbnail_id( $term_id ): Retrieve term thumbnail ID.
  • has_term_thumbnail( $term_id ): Check if a term has a thumbnail attached to it.
  • the_term_thumbnail( $term_id, $size = 'post-thumbnail', $attr = '' ): Display the term thumbnail.
  • get_term_thumbnail( $term_id, $size = 'post-thumbnail', $attr = '' ): Retrieve the term thumbnail.
  • set_term_thumbnail( $term_id, $thumbnail_id ): Set a term thumbnail.
  • delete_term_thumbnail( $term_id ): Detach a thumbnail from a term.

Store the data

4, the term metas API is used.

4, there are two ways to store the thumbnail IDs:

  • Use term metas with the plugin Meta for Taxonomies.
  • Use an option (an array association of term_taxonomy_id => thumbnail_id integers). The option name can be customized by defining the constant SFTTH_OPTION_NAME in wp-config.php.

Get terms

Use get_terms() with a specific parameter to retrieve only terms with a thumbnail:

$terms = get_terms( array( 'with_thumbnail' => true, ) );

4, you can also use a small helper to build your meta query:

$terms = get_terms( array( 'meta_query' => array( 'relation' => 'AND', array( // Any meta query. ), sftth_meta_query(), ), ) );

4, if you use the plugin Meta for Taxonomies, you should always cache thumbnails.

When using 'with_thumbnail' => false you will retrieve all terms, even those without a thumbnail, but the thumbnails will be cached, saving calls to the database later:

$terms = get_terms( array( 'with_thumbnail' => false, ) );

Uninstall

php:

define( 'SFTTH_KEEP_DATA', true );

Translations

  • US English
  • French

Requirements

2+ so far.

Credits

0 ).

WordPress.org metadata

Plugin tags

Topics listed for this plugin in the WordPress.org directory.

  • category
  • dev
  • image
  • taxonomy
  • thumbnail
Compatibility & maintenance

Compatibility & maintenance

Tested up to WordPress 4.5

Not yet marked as tested with WordPress 7.1. WordPress.org currently lists Tested up to 4.5.

Current WordPress releaseWordPress 7.1
WordPress.org Tested up to4.5
Minimum requirementsWordPress 3.5 · PHP not listed
Update activity30 May 201610y ago

“Tested up to” is directory metadata supplied by the plugin author. WP PlugIndex does not turn an older declaration into a claim that the plugin is incompatible.

Changes recorded by WP PlugIndex

Recent tracked changes

No tracked version or compatibility changes have been recorded by WP PlugIndex yet.

Tracking & source

WP PlugIndex tracks public WordPress.org directory metadata and records selected version, compatibility and availability changes as they are detected.

Plugin watchlist

Watch this plugin

Sign in to your WP PlugIndex account or create a free account. Free accounts can watch up to 5 plugins and see what changed.

Watch limit

Watchlist limit reached

You have reached your current active watch limit.