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

WordPress Trac noreply at wordpress.org
Tue Nov 14 17:03:54 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 has-dev-note                        |     Focuses:
-------------------------------------------------+-------------------------

Comment (by westonruter):

 If the post is not nullified, consider these two cases case:

 1) Someone adds a Text widget to the sidebar with a `[gallery]` shortcode
 in it, wanting to show the attachments from the current singular post. If
 this widget is shown on an index page, then it will get populated with
 whatever the last post was in the The Loop, and have unpredictable
 results. Even on a singular template it will have an unreliable result.

 2) Someone also adds a widget that lists out posts from some category on
 the site. But they don't reset the `$post` after they do so, which is a
 very common issue. For example, this was just fixed in core even for the
 Recent Posts widget: #37312. The result is that `[gallery]` would never
 show the attachments for the current queried post anyway if it relied on
 `get_post()`. It would only ever show the attachments from the last post
 in that widget that listed out posts from the category.

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


More information about the wp-trac mailing list