Taxonomy Images
[resolved] Bug report and fix: alt property of images (2 posts)

  1. jaygoldman
    Posted 6 years ago #


    Really enjoying this plugin — solved a major issue for me very elegantly.

    One bug report: I'm getting alt="Array" in my images.

    I'm calling:

    $img = $taxonomy_images_plugin->get_image_html( 'large', $term->term_taxonomy_id );

    and getting back:

    <img src="<url-omitted-but-correct>" alt="Array" title="" width="306" height="172" class="alignnone size-large wp-image-25" />

    Looks like the culprit is line 327 of taxonomy-images.php:

    $alt = get_post_meta( $attachment_id, '_wp_attachment_image_alt' );

    According to the codex page, get_post_meta returns an array unless you specific single=true.

    Changing the line to set single fixes the problem:

    $alt = get_post_meta( $attachment_id, '_wp_attachment_image_alt', true );


  2. Michael Fields
    Plugin Contributor

    Posted 6 years ago #

    Thanks for taking the time to submit the bug report! I updated the plugin as you suggested and this bug can be considered squashed. Version 0.4.4 and beyond will have the fix.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Taxonomy Images
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic