[wp-trac] [WordPress Trac] #26343: has_shortcode not recognizing nested shortcodes

WordPress Trac noreply at wordpress.org
Sat Jun 28 11:29:21 UTC 2014

#26343: has_shortcode not recognizing nested shortcodes
 Reporter:  sunyatasattva               |       Owner:
     Type:  defect (bug)                |      Status:  new
 Priority:  normal                      |   Milestone:  4.0
Component:  Shortcodes                  |     Version:  3.6
 Severity:  normal                      |  Resolution:
 Keywords:  has-patch needs-unit-tests  |     Focuses:

Comment (by engelen):

 Nested shortcodes aren't supported by core by default. As stated in the
 ticket description, one has to call `do_shortcode` in the shortcode
 contents themselves. As such, shortcode content should actually be
 considered as "raw" content: it's all parsed by the shortcode, and not
 handled outside of that.

 Therefore, one could argue that `has_shortcode` shouldn't return true for
 nested shortcodes. That's my belief, at least. I think the function works
 as it should currently, and that no support for nested shortcodes should
 be offered as long as core doesn't start parsing shortcodes bottom-up
 (i.e. first parse the most deeply nested shortcode, moving a level up each

Ticket URL: <https://core.trac.wordpress.org/ticket/26343#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list