WordPress.org

Ready to get started?Download WordPress

Forums

HungryFEED
[ in data is causing problems (5 posts)

  1. HFman
    Member
    Posted 1 year ago #

    Hi,
    I'm feeding the output of HF into a shortcode. if data (lets say the feed title) contains brackets [], then my shortcode stops working. It basically sees those brackets as the end or begning to my shortcode. Is there a way to escape/convert/replace brackets in the feed data to a different character before I feed it to my shortcode? Maybe we can modify HF code to covert brackets to their ASCII equivalent &#91 and &#93?

    let's say if the feed_title is "News from this source [PICTURES]" then in [my_shortcode change_title="{{feed_title}}"], brackets around the word 'PICTURES' mess up my shortcode.

    thanks

    http://wordpress.org/extend/plugins/hungryfeed/

  2. Jason
    Member
    Plugin Author

    Posted 1 year ago #

    That's an issue unfortunately with WordPress itself - from the page at http://codex.wordpress.org/Shortcode_API

    Square Brackets

    The shortcode parser does not accept square brackets within attributes. Thus the following will fail:

    [tag attribute="[Some value]"]

    Note: these limitations may change in future versions of WordPress, you should test to be absolutely sure.

  3. HFman
    Member
    Posted 1 year ago #

    That's what kind of guessed too. Is there a way we can modify HF code to convert brackets to their ASCII chars as it grabs the feed?

  4. laupie
    Member
    Posted 1 year ago #

    Hi,
    I'm facing the same problem here; my feed has its descriptions encapsulated in <![ CDATA [content]]>' and this also makes HF not function anymore. A solution like HFman suggested would be nice!

    Thanks

  5. Jason
    Member
    Plugin Author

    Posted 1 year ago #

    in version 1.6.1 i added the ability to pass through brackets or double-quotes in any HungryFEED shortcode param, using:

    #91; = [
    #93; = }
    #34; = "

    note that these are the html encodings for these characters except the ampersand is left off the beginning (otherwise the wordpress rich text editor winds up messing it up)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags