Skip to:
Content

BuddyPress.org

Ticket #5779: 5779.heartbeat-search.patch

File 5779.heartbeat-search.patch, 1.2 KB (added by imath, 5 years ago)
  • src/bp-activity/bp-activity-filters.php

    diff --git src/bp-activity/bp-activity-filters.php src/bp-activity/bp-activity-filters.php
    index a85342e..94e5726 100644
    function bp_activity_heartbeat_last_recorded( $response = array(), $data = array 
    489489                'activity_latest_args'
    490490        );
    491491
     492        if ( ! empty( $data['bp_activity_last_recorded_search_terms'] ) && empty( $activity_latest_args['search_terms'] ) ) {
     493                $activity_latest_args['search_terms'] = esc_html( $data['bp_activity_last_recorded_search_terms'] );
     494        }
     495
    492496        $newest_activities = array();
    493497        $last_activity_recorded = 0;
    494498
  • src/bp-templates/bp-legacy/js/buddypress.js

    diff --git src/bp-templates/bp-legacy/js/buddypress.js src/bp-templates/bp-legacy/js/buddypress.js
    index 63eb97f..5f1cc0a 100644
    jq(document).ready( function() { 
    16121612                }
    16131613
    16141614                data.bp_activity_last_recorded = activity_last_recorded;
     1615
     1616                last_recorded_search = bp_get_querystring('s');
     1617
     1618                if ( last_recorded_search ) {
     1619                        data.bp_activity_last_recorded_search_terms = last_recorded_search;
     1620                }
    16151621        });
    16161622
    16171623        // Increment newest_activities and activity_last_recorded if data has been returned