[wp-trac] [WordPress Trac] #42548: Widgets: Populate global $post with queried object on singular queries instead of nullifying it

WordPress Trac noreply at wordpress.org
Wed Nov 15 02:32:11 UTC 2017


#42548: Widgets: Populate global $post with queried object on singular queries
instead of nullifying it
-------------------------------------------+--------------------------
 Reporter:  westonruter                    |       Owner:  westonruter
     Type:  defect (bug)                   |      Status:  closed
 Priority:  normal                         |   Milestone:  4.9
Component:  Widgets                        |     Version:  4.9
 Severity:  normal                         |  Resolution:  fixed
 Keywords:  has-patch dev-reviewed commit  |     Focuses:
-------------------------------------------+--------------------------

Comment (by westonruter):

 In [changeset:"42186"]:
 {{{
 #!CommitTicketReference repository="" revision="42186"
 Widgets: Set global `$post` to current queried object instead of
 nullifying when `is_singular()` while applying filters (and shortcodes) in
 Text widget and (via plugin) Custom HTML widget.

 Also prevent `[gallery]` shortcode from dumping out every attachment on
 the site when a containing Text widget is shown on an archive template.

 Props westonruter, bobbingwide, joemcgill for testing.
 See #10457.
 Fixes #42548, #42547 for 4.9.
 }}}

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


More information about the wp-trac mailing list