Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
05/28/2013 02:42:15 AM (12 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-themes/bp-default/_inc/ajax.php

    r7095 r7116  
    126126    if ( ! empty( $_POST['page'] ) && '-1' != $_POST['page'] )
    127127        $qs[] = 'page=' . absint( $_POST['page'] );
     128
     129    // exludes activity just posted and avoids duplicate ids
     130    if ( ! empty( $_POST['exclude_just_posted'] ) ) {
     131        $just_posted = wp_parse_id_list( $_POST['exclude_just_posted'] );
     132        $qs[] = 'exclude=' . implode( ',', $just_posted );
     133    }
    128134
    129135    $object_search_text = bp_get_search_default_text( $object );
Note: See TracChangeset for help on using the changeset viewer.