[wp-trac] [WordPress Trac] #10547: There should be way to prevent WP from touching the content within a shortcode

WordPress Trac wp-trac at lists.automattic.com
Tue Aug 4 23:25:00 UTC 2009


#10547: There should be way to prevent WP from touching the content within a
shortcode
-------------------------+--------------------------------------------------
 Reporter:  godfreykfc   |       Owner:            
     Type:  enhancement  |      Status:  new       
 Priority:  low          |   Milestone:  Unassigned
Component:  Shortcodes   |     Version:            
 Severity:  normal       |    Keywords:            
-------------------------+--------------------------------------------------
 It is very furstrating now that "do_shortcode" is called after all the WP
 formatting stuff (e.g. wpautop, escaping html entities) because the
 content are usually messed up. There should be an option to get the RAW
 content.

 Possible use cases:
 * Create a [noformat]...[/noformat] shortcode
 * Create a [style]...[/style] shortcode, which will put the content into a
 <style> element and inject it into the <head>
 * Create a [markdown]...[/markdown] shortcode, which formats the content
 with markdown
 * Mini template language like the conditional custom fields shortcode
 plugin (or the php shortcode plugin)

 Obviously, it is undesirable to have the content preformatted in either of
 the use cases listed above. For instance, in the CSS example, you'd have
 to go through the trouble of unescaping the HTML entities and then
 removing all the <br /> and <p> insterted by wpautop.

 The trivial solution would be to put do_shortcode before the other
 formatting filters. However, this might have potential drawbacks too. For
 instance, the "unsafe" HTML inserted by the shortcode might get stripped
 too. (Which might or might not be a good thing). This enhancement
 obviously requries more thoughts so I'd like to see more disscusion of the
 potential advantages and disadvantages here.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/10547>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list