bp_media_get_specific( array|string $args = '' )
Fetch specific media items.
Description
See also
- BP_Media::get(): For more information on accepted arguments.
Parameters
- $args
-
(Optional) All arguments and defaults are shared with BP_Media::get(), except for the following:
- 'Single'
(string|int|array) media ID, comma-separated list of IDs, or array of IDs.
Default value: ''
- 'Single'
Return
(array) $activity See BP_Media::get() for description.
Source
File: bp-media/bp-media-functions.php
function bp_media_get_specific( $args = '' ) { $r = bp_parse_args( $args, array( 'media_ids' => false, // A single media_id or array of IDs. '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. 'sort' => 'DESC', // Sort ASC or DESC 'order_by' => false, // Sort ASC or DESC ), 'media_get_specific' ); $get_args = array( 'in' => $r['media_ids'], 'max' => $r['max'], 'page' => $r['page'], 'per_page' => $r['per_page'], 'sort' => $r['sort'], 'order_by' => $r['order_by'], ); /** * Filters the requested specific media item. * * @since BuddyBoss * * @param BP_Media $media Requested media object. * @param array $args Original passed in arguments. * @param array $get_args Constructed arguments used with request. */ return apply_filters( 'bp_media_get_specific', BP_Media::get( $get_args ), $args, $get_args ); }
Changelog
Version | Description |
---|---|
BuddyBoss 1.0.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.