You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Infinite Scroll requests are no longer being treated as ajax requests, causing various pre_get_post filters to incorrectly alter the query - breaking things pretty bad in some cases.
@WPprodigy@jeherve Thanks for bringing this to my attention, it's clearly a regression. Created a PR that ensures the X- header is sent along with the AJAX request even in vanilla JS.
Infinite Scroll requests are no longer being treated as ajax requests, causing various pre_get_post filters to incorrectly alter the query - breaking things pretty bad in some cases.
IS doesn't use a traditional WP ajax flow (unsure why?), but attempts to tell WP it is an ajax request here: https://github.com/Automattic/jetpack/blob/master/modules/infinite-scroll/infinity.php#L1725
However, with the latest changes to IS (presumably the jQuery removal), this no longer happens because
HTTP_X_REQUESTED_WITH
is never set.Replicated with JP version 8.5 and 8.4.2. Does not happen in 8.3.
One solution is to alter the PHP side and just see if the request method is POST (cleanest option?). Otherwise can continue passing
XMLHTTPREQUEST
like jQuery.ajax does around here: https://github.com/Automattic/jetpack/blob/master/modules/infinite-scroll/infinity.js#L353 (probably best for BC?)The text was updated successfully, but these errors were encountered: