/*
* Manually do shortcodes on the content when the core-added filter is present. It is added by default
* in core by adding do_shortcode() to the 'widget_text_content' filter to apply after wpautop().
* Since the legacy Text widget runs wpautop() after 'widget_text' filters are applied, the widget in
* legacy mode here manually applies do_shortcode() on the content unless the default
* core filter for 'widget_text_content' has been removed, or if do_shortcode() has already
* been applied via a plugin adding do_shortcode() to 'widget_text' filters.
*/
if ( has_filter( 'widget_text_content', 'do_shortcode'
) && !
$widget_text_do_shortcode_priority ) { if ( !
empty( $instance['filter'
] ) ) { $text =
shortcode_unautop( $text );
} $text =
do_shortcode( $text );
} } // Restore post global.
$post =
$original_post;
remove_filter( 'shortcode_atts_gallery', array
( $this, '_filter_gallery_shortcode_attrs'
) );
// Undo suspension of legacy plugin-supplied shortcode handling.
if ( $should_suspend_legacy_shortcode_support ) {