[wp-trac] [WordPress Trac] #12505: embed is not registered as a shortcode

WordPress Trac wp-trac at lists.automattic.com
Tue Apr 6 10:15:23 UTC 2010


#12505: embed is not registered as a shortcode
--------------------------+-------------------------------------------------
 Reporter:  MattyRob      |       Owner:  Viper007Bond
     Type:  defect (bug)  |      Status:  assigned    
 Priority:  normal        |   Milestone:  3.0         
Component:  Shortcodes    |     Version:  2.9.2       
 Severity:  normal        |    Keywords:              
--------------------------+-------------------------------------------------

Comment(by MattyRob):

 Thanks for the clarification - so is this (embed not being in the short
 codes list) needed because wpautop() somehow messes up the embed
 shortcode?

 My 'fix' is something like this:


 {{{
 global $shortcode_tags;

 // Backup current registered shortcodes
 $orig_shortcode_tags = $shortcode_tags;

 // Add 'embed' then strip all shortcodes
 add_shortcode( 'embed', create_function('', '') );
 $content = strip_shortcodes( $content );

 // Put the original shortcodes back
 $shortcode_tags = $orig_shortcode_tags;

 return $content;
 }}}

 I guess WordPress could introduce a second strip_shortcodes function or
 perhaps a 'force' parameter to ensure that embed is stripped out. Looking
 forwar to you fix - then I can revert mine :-)

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/12505#comment:7>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list