Skip to:
Content
Pages
Categories
Search
Top
Bottom

Get activity_get_older_updates to load in ASC order, not DESC


  • FTLRalph
    Participant

    @ftlralph

    So I added a toggle to the activity stream to load posts in ASC (oldest first) order. Works nice. Did it by hooking into like so:

    public function filterBpAjaxQuerystring( $bp_ajax_querystring, $object )
    { 
        $query_sort = $_GET['sort'];
    
        if ( isset( $query_sort ) && $query_sort === 'asc' )
        	$bp_ajax_querystring .= 'sort=ASC';
    
        return $bp_ajax_querystring;
    }
    add_filter( 'bp_ajax_querystring', array( $this, 'filterBpAjaxQuerystring'), 999, 2 ); 

    But now the problem is upon scrolling down the page and pressing “Load More”, what is loaded is the most recent posts, not the continuation of oldest-to-newest posts.

    I see upon pressing “Load More” that “activity_get_older_updates” is called. Is there a way to hook into this and modify what it returns similar to the above code for “bp_ajax_querystring” ?

    Thanks!

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.
Skip to toolbar