Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
05/28/2013 02:42:15 AM (7 years ago)
Author:
boonebgorges
Message:

Exclude dynamically added activity items when clicking Load More in directory

This prevents duplicate items appearing after Load More due to the numeric
offset caused by AJAX-inserted activity items.

Fixes #4897

Props imath

File:
1 edited

Legend:

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

    r7095 r7116  
    417417    if ( ! empty( $_POST['page'] ) && '-1' != $_POST['page'] )
    418418        $qs[] = 'page=' . absint( $_POST['page'] );
     419
     420    // exludes activity just posted and avoids duplicate ids
     421    if ( ! empty( $_POST['exclude_just_posted'] ) ) {
     422        $just_posted = wp_parse_id_list( $_POST['exclude_just_posted'] );
     423        $qs[] = 'exclude=' . implode( ',', $just_posted );
     424    }
    419425
    420426    $object_search_text = bp_get_search_default_text( $object );
Note: See TracChangeset for help on using the changeset viewer.