folders_check_folder_access( $folder_id )
Check folder access for current user or guest
Description
Parameters
- $folder_id
-
(Required)
Return
(bool)
Source
File: bp-document/bp-document-functions.php
1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 | function folders_check_folder_access( $folder_id ) { $folder = folders_get_folder( $folder_id ); if ( ! empty ( $folder ->group_id ) ) { return false; } if ( ! empty ( $folder ->privacy ) ) { if ( 'public' === $folder ->privacy ) { return true; } if ( 'loggedin' === $folder ->privacy && is_user_logged_in() ) { return true; } if ( is_user_logged_in() && 'friends' === $folder ->privacy && friends_check_friendship( get_current_user_id(), $folder ->user_id ) ) { return true; } if ( bp_is_my_profile() && $folder ->user_id === bp_loggedin_user_domain() && 'onlyme' === $folder ->privacy ) { return true; } } return false; } |
Changelog
Version | Description |
---|---|
BuddyBoss 1.4.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.