[wp-trac] [WordPress Trac] #47984: Filter pre_do_shortcode
WordPress Trac
noreply at wordpress.org
Thu Sep 5 22:25:29 UTC 2019
#47984: Filter pre_do_shortcode
-----------------------------+-----------------------------
Reporter: miyarakira | Owner: (none)
Type: feature request | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Shortcodes | Version:
Severity: normal | Keywords: has-patch
Focuses: |
-----------------------------+-----------------------------
I have some situations where an ability to override the shortcode
parse/render logic would be very useful. I've prepared and will attach a
draft version patch.
An example to demonstrate its need for my use case: currently, the
$content is first processed by `do_shortcodes_in_html_tags`, then the rest
of the text. This is problematic for some nested shortcodes where the
"parent" shortcode provides a context for its "child" shortcodes - if any
of the latter are in an HTML attribute, they're rendered ''before'' the
parent shortcode is passed its inner content. I'd like a filter to handle
it so that parent and child shortcodes are rendered in the expected order.
Another point in favor of this filter is that it would be useful to hook
onto all places where shortcodes are being rendered outside `the_content`,
for example, inside a rich text editor field.
I modelled the patch after the `pre_do_shortcode_tag`.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/47984>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list