Treehouse: Grow your CSS skills. Land your dream job.

WP: Shortcode breaking. Should be easy fix

  • # July 10, 2012 at 8:51 pm

    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?

    # July 11, 2012 at 12:04 am

    What does the function actually look like, that is where to fix the problem not the actual shortcode.

    # July 11, 2012 at 12:10 am

    additionally for your attributes try wrapping them in single quotes e.g.

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

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.