[wp-trac] [WordPress Trac] #55883: Reverse wrapping of `apply_shortcodes()` and `do_shortcode()`

WordPress Trac noreply at wordpress.org
Tue May 31 19:11:01 UTC 2022

#55883: Reverse wrapping of `apply_shortcodes()` and `do_shortcode()`
 Reporter:  SergeyBiryukov  |       Owner:  (none)
     Type:  enhancement     |      Status:  new
 Priority:  normal          |   Milestone:  Awaiting Review
Component:  Shortcodes      |     Version:
 Severity:  normal          |  Resolution:
 Keywords:  2nd-opinion     |     Focuses:

Comment (by SergeyBiryukov):

 Replying to [comment:3 namith.jawahar]:
 > What about related functions like do_shortcodes_in_html_tags and filters
 like pre_do_shortcode_tag

 Good question, thanks! For consistency, I think we can use the new naming
 for them as well.

 * `do_shortcode_tag()` → `apply_shortcode_tag()`. Since the original
 function is marked as private, we can probably deprecate it in favor of
 the new one. Looking at the
 [https://wpdirectory.net/search/01G4DQ9YHXHCRVMF4QCJWPAGMR usage in
 plugins], most instances appear to be false positives or copies of the
 * `do_shortcodes_in_html_tags()` → `apply_shortcodes_in_html_tags()`. The
 original function is not marked as private and is
 [https://wpdirectory.net/search/01G4DQFRSFQ6WKYMB5SYCXMDR1 used in about
 15 plugins]. It can be up for discussion whether to deprecate it too, or
 keep as an alias of the new one.

 * `pre_do_shortcode_tag` → `pre_apply_shortcode_tag`.
 [https://wpdirectory.net/search/01G4DQY6DBSZXXXBNWDE1CJXWT Used in about
 25 plugins].
 * `do_shortcode_tag` → `apply_shortcode_tag`.
 [https://wpdirectory.net/search/01G4DR1K3ZVBDBJ3RNYQ2QCXJ2 Used in about
 132 plugins]. Looks like we'll have to keep the old filters as aliases for
 a while, though using `apply_filters_deprecated()` for them  can also be
 an option.

 As a side note, we might want to the same for `do_blocks()` →
 `apply_blocks()` in a separate ticket.

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

More information about the wp-trac mailing list