WordPress.org

Ready to get started?Download WordPress

Forums

More Fields
Bug: HTML in Captions (6 posts)

  1. thecorkboard
    Member
    Posted 3 years ago #

    Even though HTML is said to be allowed, it's taking this HTML description:

    Copy and paste the abstract from a source like <a href="http://BN.com" target="_blank">Barnes and Noble</a> or <a href="http://amazon.com" target="_blank">Amazon.com</a>

    And turning it into this:

    Copy and paste the abstract from a source like <a href=&quot;http://BN.com&quot; target=&quot;_blank&quot;>Barnes and Noble</a> or <a href=&quot;http://amazon.com&quot; target=&quot;_blank&quot;>Amazon.com</a>

  2. Andrew Martin
    Member
    Posted 3 years ago #

    I am having this same issue. Would love to know if we can use HTML and remove the stripping in this caption field. Small thing, but it would make things easier.

  3. Sam_a
    Member
    Posted 3 years ago #

    I noticed this too.

  4. Andrew Martin
    Member
    Posted 3 years ago #

    Hey guys, not sure if you resolved this yet, but I did this and so far, everything seems to be working great. It was kind of a weird hack fix, so it would be cool to see one of the developers reply if they read this and tell me if I did something that will screw everything up :)

    On line 371 of more-fields-settings-object.php, change the line from this:

    $html = str_replace('%caption%', '<p class="mf_caption">' . stripslashes($field['caption']) . '</p>', $html);

    To this:
    $html = str_replace('%caption%', '<p class="mf_caption">' . html_entity_decode(stripslashes($field['caption'])) . '</p>', $html);

    I'm hoping using that html_entity_decode function doesn't destroy anything...again, on my setup it's working fine so I'm hoping for the best.

  5. sdhunt
    Member
    Posted 3 years ago #

    thanks Andrew, that worked for me.
    I do hope the developers fix this bug in the next version!

  6. Andrew Martin
    Member
    Posted 3 years ago #

    For sure sd,

    I would strongly recommend checking out this MUCH better plugin. They actually update it and it's insanely flexible. The way they do the image uploads is much more efficient as well.

    http://wordpress.org/extend/plugins/advanced-custom-fields/

    Don't get me wrong, I used More Fields for a LONG time, but I grew tired of them not supporting the plugin and found this much better one.

    Hope that helps. :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic