WordPress.org

Ready to get started?Download WordPress

Forums

MimeTypes Link Icons
[resolved] Possible bug in MimeTypes Link plugin for multiple calls in one page (12 posts)

  1. ripperdoc
    Member
    Posted 2 years ago #

    Hi! Great plugin but I noticed strange behaviour when calling a list of excerpts. The excerpt will show the style-code coming from mime-type, even if there is no attachment to the post.

    The problem is that you use a global variable $add_attachment_style that is not reset between calls. So it stays true, adding style code to all calls to the_content() thereafter on the same page. The fix seem to be to simply reset $add_attachment_style in beginning of function mimetype_to_icon().

  2. yagraph
    Member
    Posted 2 years ago #

    Hi,

    I noted the same problem on my current project...

    As ripperdoc suggested, I added
    $add_attachment_style = false;
    on line 252 of mime_type_link_images.php

    but it do not solve the issue...

    Have you any code to share ripperdoc ?

    Thanks for your plugin anyway !

  3. yagraph
    Member
    Posted 2 years ago #

    A link illustrating the bug :
    http://www.grandeurnature.eu/gn/creation/residences/

    Right column is generated with Recent Post Plus.

    Thanks again !

  4. eagerterrier
    Member
    Plugin Author

    Posted 2 years ago #

    @ripperdoc & @yagraph - thanks for the tips and sorry for not getting back sooner - I've been on hols.

    Funnily enough, I am releasing a new version of the plugin tomorrow that fixes this bug, allows the site owner to choose to have an enclosing div that turns the plugin off (e.g. class of wp-caption does not display the icons)

    Glad you like the plugin.

    I'll try to release the plugin around 16:00GMT, but will let you know on this channel when I have done so...

  5. yagraph
    Member
    Posted 2 years ago #

    Hi eagerterrier,

    Good news, and thanks !

    If you need any testing, please feel free to ask ;)

  6. eagerterrier
    Member
    Plugin Author

    Posted 2 years ago #

    ok - this is committed to live server

    Changes should show up soon. let me know how you get on...

    TC

  7. yagraph
    Member
    Posted 2 years ago #

    Hi eagerterrier,

    I've just updated your plugin, thanks...
    But I'm sorry to say it do not solve the issue I encounter...
    I tried to your new "Enable disabling class name" option, but with no results... I also tried your "Enable Asynchronous Replacement" with no success.
    Maybe it's not linked with this bug ?

    Please take a look here : http://www.grandeurnature.eu/gn/actions/prestations/

    See the .mtli_attachment { display:inline-block; height:24px; background-position: top left; background-attachment: scroll;
    displayed at the end of the first post when I use "the_excerpt" function to retrieve post in this category ?
    If I produce the same page with "the_content", I get those lines at the end of every post which is triggered by MimeTypes Link.

    If your understand ripperdoc suggestion, I suppose it's the way to dig into...

    If you need my template code, I can share it.

    Cheers

  8. eagerterrier
    Member
    Plugin Author

    Posted 2 years ago #

    @yagraph - OK - I understand your problem now. WP is doing my code then trimming it down for the excerpt. When it performs the strip_tags function, this just gets rid of the <style> tags, but not the stuff in between...

    I think I can switch the whole plugin around, so I enqueue the CSS as a static file in the header, then call the rest later, which would mean it wouldn't show up in the excerpt

    I can't do it today, but will try at the weekend if possible, or Tuesday latest (public holiday in UK on Monday). I will mark this post back as unresolved to give me a reminder...

  9. yagraph
    Member
    Posted 2 years ago #

    Thanks a lot eagerterrier !

    I'm not in a hurry (Tuesday is perfectly fine), but I really hope to remove thoses lines before publishing the website officially ;)

    We keep in touch, have a nice weekend.

  10. eagerterrier
    Member
    Plugin Author

    Posted 2 years ago #

    OK - just committed version 2.0.4. This should be available in an hour or so.

    I have moved all CSS into the header, so you shouldn't be bothered by this problem again.

    I won't mark this thread as resolved until I hear back from you.

  11. yagraph
    Member
    Posted 2 years ago #

    Hi eagerterrier,

    Your update quickly porpagated, and I'm glad to tell you that it completely solved my issue !
    Thanks a lot for your work, I'm nearer to publishing date now ;)

  12. eagerterrier
    Member
    Plugin Author

    Posted 2 years ago #

    really glad to hear it.

    I'll mark off as resolved. Good luck with the rest of your project...

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic