[wp-trac] [WordPress Trac] #34167: Shortcode_atts pass $shortcode

WordPress Trac noreply at wordpress.org
Tue Oct 6 10:41:40 UTC 2015


#34167: Shortcode_atts pass $shortcode
-------------------------+-----------------------------
 Reporter:  mattheu      |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  General      |    Version:  trunk
 Severity:  normal       |   Keywords:
  Focuses:               |
-------------------------+-----------------------------
 It would be useful to pass the Shortcode name as the 4th param to the
 filter `shortcode_atts_{$shortcode}`

 Use case - I am wanting to add a filter for a number of shortcodes - so I
 loop through the and add the filter. However this means that I don't know
 the exact shortcode context in the callback.

 Workaround - I am currently working around this by using a closure and
 `use` to import the `$shortcode` variable into the closure. However this
 is not PHP 5.2 compatable.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/34167>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list