ThemeForest

Disabling shortcodes inside <code> or <pre>

1076 posts
  • Elite Author
  • Has been a member for 4-5 years
  • Author had a Free File of the Month
  • Sold between 100 000 and 250 000 dollars
  • Bought between 10 and 49 items
  • Europe
  • Exclusive Author
  • Referred between 200 and 499 users
+1 more
turkhitbox says

How can one do this? Is there a short function you guys can share?

2507 posts Put a Donk On It
  • Attended a Community Meetup
  • Beta Tester
  • Bought between 10 and 49 items
  • Contributed a Tutorial to a Tuts+ Site
  • Elite Author
  • Exclusive Author
  • Has been a member for 3-4 years
  • Interviewed on the Envato Notes blog
+5 more
ThemeProvince says

strip_shortcodes();

645 posts
  • Halloween Competition Winner
  • Interviewed on the Envato Notes blog
  • Won a Competition
  • Exclusive Author
  • Has been a member for 2-3 years
  • Sold between 10 000 and 50 000 dollars
  • Referred between 50 and 99 users
  • Bought between 1 and 9 items
  • United Kingdom
iKreativ says
1382 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 3-4 years
  • Referred between 10 and 49 users
  • Serbia
wpCanyonThemes says

strip_shortcodes();

Use [ and ]

&#0091; &#0093;
2507 posts Put a Donk On It
  • Attended a Community Meetup
  • Beta Tester
  • Bought between 10 and 49 items
  • Contributed a Tutorial to a Tuts+ Site
  • Elite Author
  • Exclusive Author
  • Has been a member for 3-4 years
  • Interviewed on the Envato Notes blog
+5 more
ThemeProvince says


strip_shortcodes();

Use [ and ]

&#0091; &#0093;

That was the first thing I tried and didnt work.

1382 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 3-4 years
  • Referred between 10 and 49 users
  • Serbia
wpCanyonThemes says



strip_shortcodes();

Use [ and ]

&#0091; &#0093;
That was the first thing I tried and didnt work.

Dunno works for me.

816 posts
  • Attended a Community Meetup
  • Author had a File in an Envato Bundle
  • Bought between 1 and 9 items
  • Contributed a Tutorial to a Tuts+ Site
  • Elite Author
  • Exclusive Author
  • Has been a member for 4-5 years
+4 more
Parallelus says




strip_shortcodes();

Use [ and ]

&#0091; &#0093;
That was the first thing I tried and didnt work.
Dunno works for me.

Works for me too, but I think it’s &#91; and &#93;

1382 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 3-4 years
  • Referred between 10 and 49 users
  • Serbia
wpCanyonThemes says





strip_shortcodes();

Use [ and ]

&#0091; &#0093;
That was the first thing I tried and didnt work.
Dunno works for me.
Works for me too, but I think it’s &#91; and &#93;

Yup, but they both work :)

122 posts
  • Bought between 50 and 99 items
  • Denmark
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 10 and 49 users
  • Sold between 1 000 and 5 000 dollars
jayjdk says

I used this Text to ASCII converter earlier today http://getyourwebsitehere.com/jswb/text_to_ascii.html

Just put the full shortcode in.

701 posts
  • Bought between 1000 and 4999 items
  • Canada
  • Has been a member for 4-5 years
  • Referred between 1 and 9 users
chrismccoy says

maybe a regex? and strip_shortcodes and run it through the_content filter


<?php function hello_world($content)
  {
      if (preg_match('#\<pre?>(.+?)\<\/pre\>#s', $content, $matches)) {
          $content = strip_shortcodes($matches[1]);
      }
  }

  add_filter('the_content', 'hello_world');

?></pre>
by
by
by
by
by