bp_activity_get_specific

Fetch specific activity items.

Description

(array) bp_activity_get_specific( (string) $args = '' ); 

Returns (array)

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

Parameters (1)

0. $args — Optional. (string) => ''
All arguments and defaults are shared with BP_Activity_Activity::get(), except for the following:

Options

    ;        


    Usage

    1. if ( !function_exists( 'bp_activity_get_specific' ) ) { 
    2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-activity/bp-activity-functions.php'; 
    3.  
    4. // All arguments and defaults are shared with BP_Activity_Activity::get(), except for the following: 
    5. $args = ''; 
    6.  
    7. // NOTICE! Understand what this does before running. 
    8. $result = bp_activity_get_specific($args); 
    9.  

    Defined (1)

    The function is defined in the following location(s).

    /bp-activity/bp-activity-functions.php  
    1. function bp_activity_get_specific( $args = '' ) { 
    2.  
    3. $r = bp_parse_args( $args, array( 
    4. 'activity_ids' => false, // A single activity_id or array of IDs. 
    5. 'display_comments' => false, // True or false to display threaded comments for these specific activity items. 
    6. 'max' => false, // Maximum number of results to return. 
    7. 'page' => 1, // Page 1 without a per_page will result in no pagination. 
    8. 'per_page' => false, // Results per page. 
    9. 'show_hidden' => true, // When fetching specific items, show all. 
    10. 'sort' => 'DESC', // Sort ASC or DESC 
    11. 'spam' => 'ham_only', // Retrieve items marked as spam. 
    12. 'update_meta_cache' => true,  
    13. ), 'activity_get_specific' ); 
    14.  
    15. $get_args = array( 
    16. 'display_comments' => $r['display_comments'],  
    17. 'in' => $r['activity_ids'],  
    18. 'max' => $r['max'],  
    19. 'page' => $r['page'],  
    20. 'per_page' => $r['per_page'],  
    21. 'show_hidden' => $r['show_hidden'],  
    22. 'sort' => $r['sort'],  
    23. 'spam' => $r['spam'],  
    24. 'update_meta_cache' => $r['update_meta_cache'],  
    25. ); 
    26.  
    27. /** 
    28. * Filters the requested specific activity item. 
    29. * @since 1.2.0 
    30. * @param BP_Activity_Activity $activity Requested activity object. 
    31. * @param array $args Original passed in arguments. 
    32. * @param array $get_args Constructed arguments used with request. 
    33. */ 
    34. return apply_filters( 'bp_activity_get_specific', BP_Activity_Activity::get( $get_args ), $args, $get_args );