bp_activity_get_specific( array|string $args = '' )

Fetch specific activity items.

Description

See also

Parameters

$args

(Optional) All arguments and defaults are shared with BP_Activity_Activity::get(), except for the following:

  • 'Single'
    (string|int|array) activity ID, comma-separated list of IDs, or array of IDs.

Default value: ''

Return

(array) $activity See BP_Activity_Activity::get() for description.

Source

File: bp-activity/bp-activity-functions.php

2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
function bp_activity_get_specific( $args = '' ) {
 
    $r = bp_parse_args( $args, array(
        'activity_ids'      => false,      // A single activity_id or array of IDs.
        'display_comments'  => false,      // True or false to display threaded comments for these specific activity items.
        'max'               => false,      // Maximum number of results to return.
        'page'              => 1,          // Page 1 without a per_page will result in no pagination.
        'per_page'          => false,      // Results per page.
        'show_hidden'       => true,       // When fetching specific items, show all.
        'sort'              => 'DESC',     // Sort ASC or DESC
        'spam'              => 'ham_only', // Retrieve items marked as spam.
        'update_meta_cache' => true,
    ), 'activity_get_specific' );
 
    $get_args = array(
        'display_comments'  => $r['display_comments'],
        'in'                => $r['activity_ids'],
        'max'               => $r['max'],
        'page'              => $r['page'],
        'per_page'          => $r['per_page'],
        'show_hidden'       => $r['show_hidden'],
        'sort'              => $r['sort'],
        'spam'              => $r['spam'],
        'update_meta_cache' => $r['update_meta_cache'],
    );
 
    /**
     * Filters the requested specific activity item.
     *
     * @since BuddyPress 1.2.0
     *
     * @param BP_Activity_Activity $activity Requested activity object.
     * @param array                $args     Original passed in arguments.
     * @param array                $get_args Constructed arguments used with request.
     */
    return apply_filters( 'bp_activity_get_specific', BP_Activity_Activity::get( $get_args ), $args, $get_args );
}

Changelog

Changelog
Version Description
BuddyPress 1.2.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.