CookieMonster-plus v.1.3.13 now plays nice with ampersands

Had a report from Steve Dawson that ampersands were not being passed through properly. The short story is, now it is working when you type the & in the "Text" rather than "Visual" panel.

[cmp_tag "input value='Test?example=" example "&other=...' size='50'"]
->

The long version of the story involves digging into the WordPress core code to figure out where all the & encoded ampersands were coming from and finally finding all the places! (And nobody really wants to hear it, so ...)

Three new caveats:

  1. If you switch back to the Visual editor after making the appropriate changes in the Text editor, WordPress will be "helpful" and change them from & to & and break things again.
  2. Using this now turns off "smart quotes" and other things that wptexturize() does to the things we type. Most people will never notice the difference. This note is for those who do notice and may have issue with that.
  3. You can only put one cookie value into a given HTML tag. This becomes more of a potential issue in this use case where you might want to pass along a name and email as it passes from one site to another. Since the primary use case I'm aware of for this feature is to pass an affiliate ID, I think it is a fair solution until I process through all the potential implications of my next solution.

As usual, get the updated plugin and drop a note on the help desk if you have any questions, suggestions, or results to share!

Leave a Comment