Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
10/25/2022 07:33:13 PM (3 years ago)
Author:
imath
Message:

Improve the activity loop to be able to get items below a max. ID

The $filter parameter of this loop now includes a new $offset_lower
argument making it possible to only retrieve activities having an ID
lower than this argument provided value.

We are using this filter to avoid a possible activity duplicate when
clicking on the "Load More" link.

Closes https://github.com/buddypress/buddypress/pull/29
Fixes #4535

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-templates/bp-legacy/buddypress-functions.php

    r13306 r13344  
    766766    }
    767767
     768    if ( ! empty( $_POST['offset_lower'] ) ) {
     769        $qs[] = 'offset_lower=' . intval( $_POST['offset_lower'] );
     770    }
     771
    768772    $object_search_text = bp_get_search_default_text( $object );
    769773    if ( ! empty( $_POST['search_terms'] ) && is_string( $_POST['search_terms'] ) && $object_search_text != $_POST['search_terms'] && 'false' != $_POST['search_terms'] && 'undefined' != $_POST['search_terms'] )
Note: See TracChangeset for help on using the changeset viewer.