[wp-trac] [WordPress Trac] #10457: Parse shortcodes in text widgets by default

WordPress Trac noreply at wordpress.org
Sun Sep 10 06:32:36 UTC 2017


#10457: Parse shortcodes in text widgets by default
-------------------------------------------------+-------------------------
 Reporter:  ionfish                              |       Owner:
     Type:  enhancement                          |  westonruter
 Priority:  normal                               |      Status:  closed
Component:  Widgets                              |   Milestone:  4.9
 Severity:  normal                               |     Version:  2.8
 Keywords:  westi-likes has-patch commit has-    |  Resolution:  fixed
  unit-tests                                     |     Focuses:
-------------------------------------------------+-------------------------
Changes (by westonruter):

 * status:  accepted => closed
 * resolution:   => fixed


Comment:

 In [changeset:"41361"]:
 {{{
 #!CommitTicketReference repository="" revision="41361"
 Widgets: Add shortcode support inside Text widgets.

 * Used now in core to facilitate displaying inserted media. See #40854.
 * The `[embed]` shortcode is not supported because there is no post
 context for caching oEmbed responses. This depends on #34115.
 * Add `do_shortcode()` to the `widget_text_content` filter in the same way
 it is added for `the_content` at priority 11, with `shortcode_unautop()`
 called at priority 10 after `wpautop()`.
 * For Text widget in legacy mode, manually apply `do_shortcode()` (and
 `shortcode_unautop()` if auto-paragraph checked) if the core-added
 `widget_text_content` filter remains, unless a plugin added
 `do_shortcode()` to `widget_text` to prevent applying shortcodes twice.
 * Ensure that global `$post` is `null` while filters apply in the Text
 widget so shortcode handlers won't run with unexpected contexts.

 Props westonruter, nacin, aaroncampbell.
 See #40854, #34115.
 Fixes #10457.
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/10457#comment:59>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list