WordPress.org

Ready to get started?Download WordPress

Forums

Image Widget
[resolved] "Alternate Text" field not used (11 posts)

  1. adoliver
    Member
    Posted 1 year ago #

    Steps to Reproduce:
    1) add widget to sidebar
    2) upload new image
    3) Fill out all fields on widget page
    4) Inspect rendered source code

    Expected Behavior:
    "Alternate Text" field should be inserted into the alt attribute for the image tag.

    Actual Behavior:
    The alt attribute attached to the image takes its text from the "Title" field instead of the "Alternate Text" field. If no title is provided then no value is assigned to alt.

    Comments:
    I could potentially understand the "Title" field being used in place of the "Alternate Text" field if the "Alternate Text" field was left blank. It does not make sense to have the "Title" field trump the "Alternate Text" field because they are doing two completely different things. The "Title" is displayed in the widget and it is not always desired to have text surrounding the image. The "Alternate Text" is intended for search engines, handicap support and unloaded images--as such it is very likely to have different more descriptive text than the title.

    http://wordpress.org/extend/plugins/image-widget/

  2. adoliver
    Member
    Posted 1 year ago #

    Follow Up:

    The "Alternate Text" field is populated by the "Alternate Text" field from the wordpress media tool. However it does not get applied to the image, which is confusing.

    After playing with the widget some more I figured out that the "Alternate Text" field is being applied to the LINK TAG alt attribute. Which was very unexpected due to the presentation in your form.
    Either:
    1) Your widget form is confusing
    2) The alt text is being added to the wrong element

    If #1 is the case I would recommend having the "Alternate Text" field listed after the "Link" field and change the name to "Link Alternate Text"

  3. paracleteweb
    Member
    Posted 1 year ago #

    I believe this is the same problem as reported here?
    http://wordpress.org/support/topic/empty-alt-attribute-on-images

  4. RachelinBranson
    Member
    Posted 1 year ago #

    Does anyone know why my images are all showing up with a blue box around them?? Only in Internet Explorer 9 does this happen and it looks horrible..

    Here is the website: http://www.toepull.com/

  5. joerhoney
    Member
    Posted 8 months ago #

    RachelinBranson, that is a CSS issue with Explorer. Try this in your stylesheet:
    img { border: none; }
    But this is not the place for such an issue.

  6. joerhoney
    Member
    Posted 8 months ago #

    As an note to the developer (and to help others in the meantime), a solution for this issue was provided in this thread: http://wordpress.org/support/topic/empty-alt-attribute-on-images

  7. Degas
    Member
    Posted 8 months ago #

    The code in image-widget.php has changed since the fix in paracleteweb's link above.

    In 4.0.8 I've now just changed line 279 to
    $instance['alt'] = $new_instance['alt'];
    to now generate the alt text properly.

    whilst this fixes the alt text, it now also makes the title element show as the alt text! Taking the original fix as a starter, in 4.0.8 I've changed line 505 to
    'title' => ( !empty( $instance['title'] ) ) ? $instance['title'] : $instance['alt'],
    which gets the title to render properly again.

  8. galbaras
    Member
    Posted 4 months ago #

    I'm on 4.0.8, but alt text did not show until I set a title, which I then hide with CSS :(

  9. Peter Chester
    Modern Tribe
    Plugin Author

    Posted 3 months ago #

    Thank you all for your patience on this. Sorry, I've been unable to get to this for a while but I'm going to release an update in the next few days that fixes this.

    Thanks!

  10. Peter Chester
    Modern Tribe
    Plugin Author

    Posted 3 months ago #

    Ok, this is deployed. I welcome any ratings and especially clicks on the 'Works' with 3.9 button. Thanks!

  11. Peter Chester
    Modern Tribe
    Plugin Author

    Posted 3 months ago #

    Oh, and this is resolved. :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic