Make WordPress Core


Ignore:
Timestamp:
09/20/2022 10:29:55 AM (2 years ago)
Author:
audrasjb
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/media.php

    r54226 r54248  
    22972297            $style,
    22982298            esc_attr( $class ),
    2299             do_shortcode( $content ),
     2299            apply_shortcodes( $content ),
    23002300            sprintf(
    23012301                '<figcaption %sclass="wp-caption-text">%s</figcaption>',
     
    23102310            $style,
    23112311            esc_attr( $class ),
    2312             str_replace( '<img ', '<img ' . $describedby, do_shortcode( $content ) ),
     2312            str_replace( '<img ', '<img ' . $describedby, apply_shortcodes( $content ) ),
    23132313            sprintf(
    23142314                '<p %sclass="wp-caption-text">%s</p>',
Note: See TracChangeset for help on using the changeset viewer.