Shortcodes: Reverse wrapping of apply_shortcodes() and do_shortcode().

This changeset reverses the wrapping of `apply_shortcodes()` and `do_shortcode()` such that `apply_shortcodes()` is now the recommended function. In addition:

- Calls to `do_shortcode()` have been changed to `apply_shortcodes()`.
- Some default filter callbacks have been changed from `'do_shortcode'` to `'apply_shortcodes'`.
- Applicable documentation has been updated to refer to `apply_shortcodes()` instead.

Follow-up to [47004].

Props SergeyBiryukov, rafiahmedd, namithjawahar, peterwilsoncc, costdev.
Fixes #55883.


git-svn-id: https://develop.svn.wordpress.org/trunk@54248 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jb Audras
2022-09-20 10:29:55 +00:00
parent 1b3b794265
commit 270629df0e
7 changed files with 37 additions and 37 deletions
+2 -2
View File
@@ -2296,7 +2296,7 @@ function img_caption_shortcode( $attr, $content = '' ) {
$describedby,
$style,
esc_attr( $class ),
do_shortcode( $content ),
apply_shortcodes( $content ),
sprintf(
'<figcaption %sclass="wp-caption-text">%s</figcaption>',
$caption_id,
@@ -2309,7 +2309,7 @@ function img_caption_shortcode( $attr, $content = '' ) {
$id,
$style,
esc_attr( $class ),
str_replace( '<img ', '<img ' . $describedby, do_shortcode( $content ) ),
str_replace( '<img ', '<img ' . $describedby, apply_shortcodes( $content ) ),
sprintf(
'<p %sclass="wp-caption-text">%s</p>',
$caption_id,