benhuson / Taxonomy-Images

Enables WordPress users to easily associate images from the media library to categories, tags and custom taxonomies.
https://wordpress.org/plugins/taxonomy-images/
21 stars 5 forks source link

WP 4.4 term meta #25

Closed GaryJones closed 1 year ago

GaryJones commented 8 years ago

WP 4.4 obviously officially supports term meta. Might you switch over to using this, so it becomes standard, for those that run the plugin on 4.4+?

benhuson commented 8 years ago

Yep, planning to add support for that.

Just need to write an upgrade script for existing users who upgrade.

benhuson commented 8 years ago

Plan of action:

jaredatch commented 8 years ago

:+1:

jaredatch commented 8 years ago

Any chance this is still planned?

benhuson commented 8 years ago

Yep. I nearly have a version working that allows the use of the new WordPress get_term_meta() functions, but currently hooks into the existing options-based data. When I've tested that I'll make that available as a release.

Then I'll work in a migration routine to move the options-based data to 'real' term meta in a following release.

benhuson commented 8 years ago

If you'd like to test term meta support, please download and try this branch: https://github.com/benhuson/Taxonomy-Images/tree/feature/term-api

You will then be able to get the ID for an image and output it like this:

$image_id = get_term_meta( $term_id, 'taxonomy_image_id', true );
echo wp_get_attachment_image( $image_id, 'thumbnail' );
jaredatch commented 8 years ago

Will do 👍