[wp-trac] [WordPress Trac] #37906: Filter to short-circuit do_shortcode_tag

WordPress Trac noreply at wordpress.org
Thu Sep 1 07:10:23 UTC 2016


#37906: Filter to short-circuit do_shortcode_tag
-------------------------+-----------------------------
 Reporter:  ideag        |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Shortcodes   |    Version:  trunk
 Severity:  normal       |   Keywords:
  Focuses:               |
-------------------------+-----------------------------
 Working for a client I noticed that there is no way for plugins to modify
 or short-circuit shortcode output.

 My use case - I wanted to fragment-cache some resource-intensive
 shortcodes from other plugins. In my case I solved it by introducing new
 shortcode and calling `do_shortcode` from inside, but I think a general
 filter for this would be good to have. We do have similar `pre_` type of
 filters for http requests, get_option and elswhere, so introducing one for
 shortcodes would be good for consistency, to.

 My suggestion is to introduce a `pre_do_shortcode_tag` filter that would
 allow plugins to short-circuit and return their own value for any
 shortcode they choose. I am attaching a possible patch for this.

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


More information about the wp-trac mailing list