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/block-template.php

    r53728 r54248  
    243243    $content = shortcode_unautop( $content );
    244244    $content = wp_filter_content_tags( $content );
    245     $content = do_shortcode( $content );
     245    $content = apply_shortcodes( $content );
    246246    $content = str_replace( ']]>', ']]>', $content );
    247247
Note: See TracChangeset for help on using the changeset viewer.