[buddypress-trac] [BuddyPress Trac] #5370: bp_legacy_theme_ajax_querystring per_page stopped working
buddypress-trac
noreply at wordpress.org
Mon Feb 3 22:37:08 UTC 2014
#5370: bp_legacy_theme_ajax_querystring per_page stopped working
-------------------------------+------------------------------
Reporter: modemlooper | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Core | Version: 1.9.1
Severity: normal | Resolution:
Keywords: reporter-feedback |
-------------------------------+------------------------------
Changes (by boonebgorges):
* keywords: dev-feedback => reporter-feedback
Comment:
OK, looks like your filter is not correctly written. You're wiping out the
entire $query_string, which means that the pagination arguments on
subsequent pages are getting wiped out too. You have to add your param,
not overwrite the whole thing:
{{{
function my_bp_loop_querystring( $query_string, $object ) {
if ( ! empty( $query_string ) ) {
$query_string .= '&';
}
$query_string .= 'per_page=2';
return $query_string;
}
add_action( 'bp_legacy_theme_ajax_querystring', 'my_bp_loop_querystring',
20, 2 );
}}}
I know this isn't the most elegant thing in the world, but it's how the
filter has always worked. (We should come up with something a little
easier to deal with in the future.)
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5370#comment:2>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list