WordPress.org

Forums

Get the Image
[resolved] multiple classnames broken in 0.8 (6 posts)

  1. bencallahan
    Member
    Posted 3 years ago #

    I just upgraded to .8 and noticed that my images with multiple class names are being combined (spaces are removed).

    This:

    get_the_image( array( 'image_scan' => true,
         'image_class' => 'article-image alignleft',
         'size' => 'thumbnail'
         )
    ); ?>

    is spitting out:

    <img src="correct-url" alt="alt-tag" class="Thumbnail thumbnail article-imagealignleft">

    This has always worked for me in the past. Can it be fixed?

    http://wordpress.org/extend/plugins/get-the-image/

  2. Pepe Huerta
    Member
    Posted 3 years ago #

    I can confirm.. it happens in my instalation too (WP 3.4, GTI 0.8)

  3. Justin Tadlock
    WordPress God
    Plugin Author

    Posted 3 years ago #

    This is not broken. It was broken before when you were able to add multiple classes. Version 0.8 fixes this bug.

  4. Pepe Huerta
    Member
    Posted 3 years ago #

    And why we cant add multiple classes? Is there any way to add more than one?

  5. Justin Tadlock
    WordPress God
    Plugin Author

    Posted 3 years ago #

    The plugin doesn't allow multiple classes. It was never meant to. The ability to add multiple classes before was a bug that has now been corrected in version 0.8.

  6. revoiced
    Member
    Posted 3 years ago #

    Justin - first off thanks for the plugin, its very useful for me.

    Regarding this change... it would be great if you supported multiple classes. Not sure what the logic for not supporting it is, but supporting it has good use cases: I am intentionally applying multiple classes to images (I have a generic alignment class, then another class to stylize images in certain sections). The ability to do that is now gone and I have to write messier CSS to support it.

    Sanitize classes with sanitize_html_class() - that patch note sounded fairly innocent. I read the patch notes before applying the update but was greeted by a broken set of CSS because of the change.

    I don't mean to sound ungrateful, just want you to be aware of how many people depend on clear functionality and patch notes.

    Thanks,
    Zack

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Get the Image
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic