Re: URGENT – How To Set Default Values?
It looks like you need to do two things.
1) Don’t do bp_ajax_querystring( ‘friends’ ). The function does not take arguments like ‘friends’. Just do bp_ajax_querystring() in the template file.
2) Here is a function that, when placed in wp-content/plugins/bp-custom.php, will do what you want:
`function bbg_my_friends_activity_default( $qs ) {
if ( is_user_logged_in() && empty( $qs ) && empty( $_POST ) ) {
$qs = ‘scope=friends’;
}
return $qs;
}
add_filter( ‘bp_ajax_querystring’, ‘bbg_my_friends_activity_default’, 999 );`
The problem is that this is almost certain not to work correctly with the function you have in your template file:
`function my_query_filter_new ( $query_string ) {
$query_string .= ‘&per_page=10’;
return $query_string; }
add_filter( ‘bp_ajax_querystring’, ‘my_query_filter_new’ );`
If you need this latter functionality, I would try to do some work to combine the functions so that the query strings are added in the proper order.