[wp-trac] [WordPress Trac] #37767: Conditionally modify $tagnames in strip_shortcodes()

WordPress Trac noreply at wordpress.org
Thu Oct 27 11:26:01 UTC 2016


#37767: Conditionally modify $tagnames in strip_shortcodes()
-------------------------------------------------+-------------------------
 Reporter:  danielbachhuber                      |       Owner:
     Type:  enhancement                          |  aaroncampbell
 Priority:  normal                               |      Status:  reopened
Component:  Shortcodes                           |   Milestone:  4.7
 Severity:  normal                               |     Version:
 Keywords:  good-first-bug has-patch has-unit-   |  Resolution:
  tests                                          |     Focuses:
-------------------------------------------------+-------------------------

Comment (by swissspidy):

 @sebastian.pisula How are you calling `strip_shortcodes()`?

 This should work totally fine. There's a unit test to prove that.

 {{{#!php
 <?php
 add_filter('strip_shortcodes_tagnames', function(){
         return array( 'gallery' );
 });
 $output = strip_shortcodes( 'before [gallery link="file"
 ids="603,582,580,578"] after' );
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/37767#comment:18>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list