[wp-trac] [WordPress Trac] #47616: Enhancement: doing_shortcode() function similar to doing_filter()

WordPress Trac noreply at wordpress.org
Tue Feb 2 17:26:31 UTC 2021


#47616: Enhancement: doing_shortcode() function similar to doing_filter()
-------------------------------------------------+-------------------------
 Reporter:  keraweb                              |       Owner:  audrasjb
     Type:  enhancement                          |      Status:  accepted
 Priority:  normal                               |   Milestone:  5.7
Component:  Shortcodes                           |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-docs needs-dev-note  |     Focuses:
  commit 2nd-opinion                             |
-------------------------------------------------+-------------------------
Changes (by jorbin):

 * keywords:  has-patch needs-docs needs-dev-note commit => has-patch needs-
     docs needs-dev-note commit 2nd-opinion


Comment:

 In theory, I like this enhancement, but I'm less sure about the
 implementation.

 I have some concerns about the proposed implementation of
 `current_shortcode`. Since shortcodes can be nested, it's possible to be
 in multiple shortcodes at once yet checking current_shortcode() will only
 return one.  This can lead to unexpected behavior.

 I also don't love the idea of adding yet another global variable.

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


More information about the wp-trac mailing list