Changeset 54248 for trunk/src/wp-includes/widgets/class-wp-widget-text.php
- Timestamp:
- 09/20/2022 10:29:55 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/widgets/class-wp-widget-text.php
r52978 r54248 245 245 /* 246 246 * Suspend legacy plugin-supplied do_shortcode() for 'widget_text' filter for the visual Text widget to prevent 247 * shortcodes being processed twice. Now do_shortcode() is added to the 'widget_text_content' filter in core itself247 * shortcodes being processed twice. Now apply_shortcodes() is added to the 'widget_text_content' filter in core itself 248 248 * and it applies after wpautop() to prevent corrupting HTML output added by the shortcode. When do_shortcode() is 249 * added to 'widget_text_content' then do_shortcode() will be manually called when in legacy mode as well.249 * added to 'widget_text_content' then apply_shortcodes() will be manually called when in legacy mode as well. 250 250 */ 251 251 $widget_text_do_shortcode_priority = has_filter( 'widget_text', 'do_shortcode' ); … … 303 303 /* 304 304 * Manually do shortcodes on the content when the core-added filter is present. It is added by default 305 * in core by adding do_shortcode() to the 'widget_text_content' filter to apply after wpautop().305 * in core by adding apply_shortcodes() to the 'widget_text_content' filter to apply after wpautop(). 306 306 * Since the legacy Text widget runs wpautop() after 'widget_text' filters are applied, the widget in 307 * legacy mode here manually applies do_shortcode() on the content unless the default307 * legacy mode here manually applies apply_shortcodes() on the content unless the default 308 308 * core filter for 'widget_text_content' has been removed, or if do_shortcode() has already 309 309 * been applied via a plugin adding do_shortcode() to 'widget_text' filters. … … 313 313 $text = shortcode_unautop( $text ); 314 314 } 315 $text = do_shortcode( $text );315 $text = apply_shortcodes( $text ); 316 316 } 317 317 }
Note: See TracChangeset
for help on using the changeset viewer.