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
Is your feature request related to a problem? Please describe.
Back in the v1 there was a way to get the currently running query object via posts.get_query() function. I've noticed that was removed from the new version without any notice in the upgrade guide. Is there any alternative for that in the v2.0?
Describe the solution you’d like
I'd love to be able to grab the current query from the posts object with posts.query just like we can with posts.pagination.
Describe alternatives you’ve considered
I've tried grabbing the $wp_query via custom Twig function but it only works if you're using the default archive query (not a custom one).
Additional context
I'd like to build a custom pagination utilising infinite loading and to do that I need to be able to pass the current query_vars as I'm reusing the same pagination component in multiple places so the scripts must know what the current query actually is.
The text was updated successfully, but these errors were encountered:
I've noticed that was removed from the new version without any notice in the upgrade guide. Is there any alternative for that in the v2.0?
We simply missed that for 2.0 😅. I added a pull request in #2613 that should fix this. To match the new method naming conventions for getter functions, we’ll probably rename it from get_query() to query(). You’ll get a deprecation notice if you’ll use get_query().
Is your feature request related to a problem? Please describe.
Back in the v1 there was a way to get the currently running query object via
posts.get_query()
function. I've noticed that was removed from the new version without any notice in the upgrade guide. Is there any alternative for that in the v2.0?Describe the solution you’d like
I'd love to be able to grab the current query from the posts object with
posts.query
just like we can withposts.pagination
.Describe alternatives you’ve considered
I've tried grabbing the
$wp_query
via custom Twig function but it only works if you're using the default archive query (not a custom one).Additional context
I'd like to build a custom pagination utilising infinite loading and to do that I need to be able to pass the current
query_vars
as I'm reusing the same pagination component in multiple places so the scripts must know what the current query actually is.The text was updated successfully, but these errors were encountered: