Support » Plugin: Advanced Post List » Escaping

  • Hi,

    I’d like to upgrade to 0.3.4 from 0.3.1 but I found an issue: I use a post meta value with product prices as simple text strings ($1,234.88) and the “$1” now gives undesired effects: it shows as:

    name="product_price",234.88

    By escaping it (\$1,234.88) the problem disappears, but it’s not that simple to replace all “$” in my situation. In 0.3.1 it was working just fine, i.e. showing the price as string without any substitutions.

    Is it a bug? Or how do you suggest to get around it?

    Thanks

    • This topic was modified 2 years, 7 months ago by cwfaraday.
    • This topic was modified 2 years, 7 months ago by cwfaraday.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author EkoJR

    (@ekojr)

    Sorry I Haven’t replied sooner. I usually try to reply within 24-48 hrs, but it’s been a busy week.

    I designed the Post Meta shortcode to grab raw (string) data, but it seems the dollar sign is throwing a wrench into the works.

    Hmm, I could add this to an update, or at least look into it. I’m just worried about conflicts with, and possibly unnecessary, pre-formatting. The best option, a builtin workaround, would be to create a PHP function in a child theme that the [php_function] shortcode can call.

    I’m not sure how well versed you are in PHP, but you could almost take the same meta shortcode function, and apply the number_format() function. This question: Add dollar sign and commas to a number? Explains how to work around this issue.

    • This reply was modified 2 years, 7 months ago by EkoJR.

    Hi EkoJR,

    the same issue appears with the $ sign in post titles, on which I’m not sure how I could apply a shortcode.

    For example, a common title like “Best under $500” results in “Best under 0”.

    Any ideas?

    Thanks
    Chris

    Plugin Author EkoJR

    (@ekojr)

    Still unsure exactly why this is occurring. My first thought is the $ is a unique key character to PHP.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Escaping’ is closed to new replies.