treehouse : what would you like to learn today?
Web Design Web Development iOS Development

WP: Shortcode breaking. Should be easy fix

  • Hi, I made a shortcode on a Wordpress site that lets the put in formatted blocks of content like tabs and toggle boxes. It looks like:
    [tab title="Title Here" content="Content Here"]
    Which is fine and dandy. However, when they uses has Double Quotes in the Title or Content, it breaks the shortcode. Is there a way to have double quotes without manually escaping each one or something?
  • What does the function actually look like, that is where to fix the problem not the actual shortcode.
  • additionally for your attributes try wrapping them in single quotes e.g.



    [tab title=' "Title Here" ' content="Content Here"]