• Resolved pajtai

    (@pajtai)


    How can you escape shortcodes in a way that you can freely switch between the Visual and HTML editors?

    I saw this post saying that you can use the HTML entity codes for “[” and “]”, but then you cannot switch between Visual and HTML editors.

    The reason I need this is that I’ve written a plugin using shortcodes, and I’m creating a sample page that describes and demonstrates the use of the shortcodes. I want to actively encourage the user to switch between Visual and HTML modes, since this is for a code highlighting plugin, so it’s important to understand where the PRE tags are.

Viewing 2 replies - 1 through 2 (of 2 total)
  • WordPress won’t expand the shortcode if you use two sets of brackets instead of one:

    [[gallery]] will render as [gallery].

    That way you don’t have to worry about switching to the visual editor. Only problem is that you’ll still get two sets of brackets if the plugin that handles that shortcode is disabled. Fortunately there’s a ticket for this and it should be fixed soon.

    Thread Starter pajtai

    (@pajtai)

    Thanks foobuilder! That’s what I was looking for. By the way, looks like if you use a start and end tag the code is [[shortcode] ... [shortcode]] With only one bracket on the insides but two for the very first and very last.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How do you escape shortcodes?’ is closed to new replies.