Make WordPress Core


Ignore:
Timestamp:
09/20/2022 10:29:55 AM (20 months 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/default-filters.php

    r54226 r54248  
    229229add_filter( 'widget_block_content', 'do_blocks', 9 );
    230230add_filter( 'widget_block_content', 'wp_filter_content_tags' );
    231 add_filter( 'widget_block_content', 'do_shortcode', 11 );
     231add_filter( 'widget_block_content', 'apply_shortcodes', 11 );
    232232
    233233add_filter( 'block_type_metadata', 'wp_migrate_old_typography_shape' );
     
    606606
    607607// Shortcodes.
    608 add_filter( 'the_content', 'do_shortcode', 11 ); // AFTER wpautop().
     608add_filter( 'the_content', 'apply_shortcodes', 11 ); // AFTER wpautop().
    609609
    610610// Media.
Note: See TracChangeset for help on using the changeset viewer.