BP_REST_Activity_Endpoint::show_hidden( string $component, int $item_id )
Show hidden activity?
Description
Parameters
- $component
-
(Required) The activity component.
- $item_id
-
(Required) The activity item ID.
Return
(boolean)
Source
File: bp-activity/classes/class-bp-rest-activity-endpoint.php
protected function show_hidden( $component, $item_id ) { $user_id = get_current_user_id(); $retval = false; if ( ! is_null( $component ) ) { // If activity is from a group, do an extra cap check. if ( ! $retval && ! empty( $item_id ) && bp_is_active( $component ) && buddypress()->groups->id === $component ) { // Group admins and mods have access as well. if ( groups_is_user_admin( $user_id, $item_id ) || groups_is_user_mod( $user_id, $item_id ) ) { $retval = true; // User is a member of the group. } elseif ( (bool) groups_is_user_member( $user_id, $item_id ) ) { $retval = true; } } } // Moderators as well. if ( bp_current_user_can( 'bp_moderate' ) ) { $retval = true; } return (bool) $retval; }
Changelog
Version | Description |
---|---|
0.1.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.