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
Just reporting an issue and providing potential fix, I don't have enough time to pull req but would be great if you could include.
Background - I have a plugin that creates custom queries, and one of our users wanted to integrate the results from the query our plugin generates with your pagination.
I took a quick look and I've noticed you have the option to pass in custom_query which looks great and should work, however looking at the code I do see a potential error - on line 26:
$page = intval( get_query_var( 'paged' ) );
You get the current page variable using get_query_var, this function only accesses the global $wp_query so it can in fact (under certain circumstances) be incorrect - as is the case with our plugin.
Something I figured out is that you can get the paged variable directly from the query -
$page = $args['custom_query']->query['paged'];
which I think would cover all use cases.
Anyway would be great to get that change integrated, let me know what you think!
The text was updated successfully, but these errors were encountered:
Hi there,
Just reporting an issue and providing potential fix, I don't have enough time to pull req but would be great if you could include.
Background - I have a plugin that creates custom queries, and one of our users wanted to integrate the results from the query our plugin generates with your pagination.
I took a quick look and I've noticed you have the option to pass in
custom_query
which looks great and should work, however looking at the code I do see a potential error - on line 26:$page = intval( get_query_var( 'paged' ) );
You get the current page variable using
get_query_var
, this function only accesses the global$wp_query
so it can in fact (under certain circumstances) be incorrect - as is the case with our plugin.Something I figured out is that you can get the paged variable directly from the query -
$page = $args['custom_query']->query['paged'];
which I think would cover all use cases.
Anyway would be great to get that change integrated, let me know what you think!
The text was updated successfully, but these errors were encountered: