Changes between Initial Version and Version 2 of Ticket #19927
- Timestamp:
- 12/17/2013 01:24:18 AM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #19927 – Description
initial v2 1 In do_shortcode_tag there is some code that allows a shortcode to be escaped. It is commented with2 // allow [[foo]] syntax for escaping a tag 1 In do_shortcode_tag() there is some code that allows a shortcode to be escaped. It is commented with 2 `// allow [[foo]] syntax for escaping a tag` 3 3 This code is fine if do_shortcode() is only invoked once on a particular chunk of data. 4 4 5 5 But if the code is run more than once then the 'escaped' shortcode once again gets selected for processing and the shortcode is expanded. 6 e.g. [ [ caption ] ] will be 'escaped' to [ caption ]which then gets processed.6 e.g. `[ [ caption ] ]` will be 'escaped' to `[ caption ]` which then gets processed. 7 7 8 8 Although this multiple invocation does not normally happen in vanilla WordPress, it is very easy to cause it to occur. 9 9 10 10 In my case I noticed the problem since I had added the filter for 'the_content' with a different priority from the WordPress default. 11 e.g. add_filter( 'the_content', 'do_shortcode');I'd missed the '11'.11 e.g. `add_filter( 'the_content', 'do_shortcode');` I'd missed the '11'. 12 12 13 13 Having removed that offending line of code I then discovered that Artisteer generated themes call get_the_excerpt() as well as the_excerpt() AND I'd added do_shortcode for both these filters. 14 14 15 15 The fix is simple. Instead of simply removing the outer square brackets, ensure that the first left square bracket is the escaped character [ 16 17 18
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)