Skip to:
Content
Pages
Categories
Search
Top
Bottom
Codex HomeDeveloper ResourcesFunction Examples → bp_ajax_querystring()

bp_ajax_querystring()

You can filter the output of the Activity loop using bp_ajax_querystring. Read about other queries you can pass the activity stream and learn more about the Activity loop here.

function filtering_activity_default( $query ) {
  if ( empty( $query ) && empty( $_POST ) ) {
    $query = 'action=activity_update';
  }
  return $query;
}
add_filter( 'bp_ajax_querystring', 'filtering_activity_default', 999 );

 

To filter ajax:

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 );

Source File

bp_ajax_querystring() is located in bp-core/bp-core-template.php

Skip to toolbar