WP 4.9 will automatically enable shortcodes in widgets. https://make.wordpress.org/core/2017/10/24/widget-improvements-in-wordpress-4-9/
One reason for the long delay with adding shortcode support in Text widgets was due to many shortcodes looking for a global $post when they run. Since the global $post varies depending on whatever the query is, the shortcodes in a Text widget could render wildly different on different templates of a site. The solution worked out was to temporarily nullify the global $post before doing the shortcodes so that they will consistently have the same global state, with this global $post then restored after the shortcodes are done. So if you have shortcodes that depend on a global $post鈥攐r call get_post()鈥攖hen you should make sure that they short-circuit when $post is null in order for them to behave properly if used in the Text widget.
The [purchase_link] shortcode calls global $post so it would be good to ensure it works properly in widgets with 4.9.
This likely breaks our Download Details widget too when it is set to display info for Current Download.
@sunnyratilal could you hop on this asap?
Yep
Tested [downloads], [purchase_link] shortcode and the Download Details widgets on installed WordPress themes, Vendd and Themedd on WordPress 4.9 Beta 3.
All working fine without any changes being required. Seems Core have added the necessary backwards compatibility to stop it breaking existing widgets.
Will keep this open for a few more days, WordPress 4.9 RC1 is scheduled to drop tomorrow so will retest again before closing.
Tested again on RC1 and all widgets are working as expected.
Most helpful comment
Tested
[downloads],[purchase_link]shortcode and theDownload Detailswidgets on installed WordPress themes, Vendd and Themedd on WordPress 4.9 Beta 3.All working fine without any changes being required. Seems Core have added the necessary backwards compatibility to stop it breaking existing widgets.