• Resolved klotim

    (@klotim)


    Removes classes from custom images and alt attr (might be svgs only) added via php. It doesn’t remove from imgs added through themes but the custom ones I echoed via php is filtered.
    The targeted imgs is svgs only.

    For example I wrote this:
    echo "<span class='tflag'>" . "<a href='linkhere'>" . "<img class='fromtcat' alt='fromtcat' src="urlhere.svg" />" . "</a>" . "</span>";

    The output was: <img src="urlhere.svg" height="auto" width="100%" />
    the css was: width:67px; height:auto;
    It should be: <img class="fromtcat" alt="fromtcat" src="urlhere.svg" height="auto" width="67px" />

    • This topic was modified 7 years, 6 months ago by klotim. Reason: forgot to add code format
    • This topic was modified 7 years, 6 months ago by klotim.
    • This topic was modified 7 years, 6 months ago by klotim.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Ethan O’Sullivan

    (@ethanosullivan)

    Is there a reason why you don’t have the width/height entered in manually? The plugin does not pull the dimensions based off of the CSS.

    Thread Starter klotim

    (@klotim)

    Well I could add it myself ofc but it clearly has some faulty code considering that it filters the result with only src and height/width.

    WP formated my code, see my edit again if you missed that.
    Tried svg with theme and does seem to effect theme svgs as well.

    Its not critical for me as I can edit it but future clients and other users might need the svg fix. Don’t you think?

    Everything else works great.

    Thread Starter klotim

    (@klotim)

    Second reason is that class might be required for responsive css imgs

    Plugin Contributor Ethan O’Sullivan

    (@ethanosullivan)

    I’ll take a deeper look at it this weekend and get back to you. If you have free-time to make improvements to the plugin, feel free to do so on our GitHub, I’ll add you to the credits.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Removes img classes/alt attr and wrong width/height output (maybe svgs only)’ is closed to new replies.