Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
07/27/2024 07:58:27 PM (8 months ago)
Author:
espellcaste
Message:

Activity: Add cache_results flag to the BP_Activity_Activity::get getter.

When performing a request with cache_results, it stops the activity information retrieved from being added to the cache.

See #8552
Closes https://github.com/buddypress/buddypress/pull/343/

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-activity/bp-activity-functions.php

    r13927 r13988  
    18711871 * @since 1.2.0
    18721872 * @since 2.4.0 Introduced the `$fields` parameter.
     1873 * @since 15.0.0 Introduced the `cache_results` parameter.
    18731874 *
    18741875 * @see BP_Activity_Activity::get() For more information on accepted arguments
     
    18991900            'in'                => false,        // Comma-separated list or array of activity IDs to which you want to limit the query.
    19001901            'spam'              => 'ham_only',   // 'ham_only' (default), 'spam_only' or 'all'.
     1902            'cache_results'     => true,
    19011903            'update_meta_cache' => true,
    19021904            'count_total'       => false,
     
    19381940            'in'                => $r['in'],
    19391941            'spam'              => $r['spam'],
     1942            'cache_results'     => $r['cache_results'],
    19401943            'update_meta_cache' => $r['update_meta_cache'],
    19411944            'count_total'       => $r['count_total'],
     
    19601963 *
    19611964 * @since 1.2.0
     1965 * @since 15.0.0 Introduced the `cache_results` parameter.
    19621966 *
    19631967 * @see BP_Activity_Activity::get() For more information on accepted arguments.
     
    19851989            'sort'              => 'DESC',     // Sort ASC or DESC.
    19861990            'spam'              => 'ham_only', // Retrieve items marked as spam.
     1991            'cache_results'     => true,
    19871992            'update_meta_cache' => true,
    19881993        ),
     
    19992004        'sort'              => $r['sort'],
    20002005        'spam'              => $r['spam'],
     2006        'cache_results'     => $r['cache_results'],
    20012007        'update_meta_cache' => $r['update_meta_cache'],
    20022008    );
Note: See TracChangeset for help on using the changeset viewer.