May I suggest using Term Meta instead of Options?
-
Hi Eduardo,
I like your plugin, however our website stores all meta for taxonomies as Term Meta. WordPress has supported this for some time now.
The only caveat will be that you’ll need to write a conversion script to move people over to Term Meta. This is not difficult.
I have had to do the following to your plugin to make it neater on my site.
// $attachment_id = get_option('categoryimage_'.$term_id); $attachment_id = get_term_meta( $term_id, 'categoryimage_attachment', true );
// update_option('categoryimage_'.$term_id, $attachment_id); update_term_meta( $term_id, 'categoryimage_attachment', $attachment_id ); // delete_option('categoryimage_'.$term_id); delete_term_meta( $term_id, 'categoryimage_attachment' );
// return get_option('categoryimage_'.$term_id); return get_term_meta( $term_id, 'categoryimage_attachment', true );
Regards,
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘May I suggest using Term Meta instead of Options?’ is closed to new replies.