Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #42548


Ignore:
Timestamp:
11/14/2017 06:03:25 PM (7 years ago)
Author:
westonruter
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #42548 – Description

    initial v1  
    88I think we can fix both of these issues simply by checking if `is_singular()` and if so, set the `$post` to the current queried object (`get_queried_object()`). This will ensure that the global `$post` isn't coming from an unpredictable source (such as a previous query that failed to call `wp_reset_postdata()`), which was a primary motivator for nullifying the global `$post` to begin with.
    99
    10 This same approach can be done for the Custom HTML widget, which currently doesn't nullify `$post` even though it does apply `widget_text` filters (though not for shortcodes in core).
     10This same approach can be done for the Custom HTML widget, which currently doesn't nullify `$post` even though it does apply `widget_text` filters (though not for shortcodes in core). This would close #42547.