Changeset 13531 for trunk/src/bp-core/bp-core-caps.php
- Timestamp:
- 07/28/2023 04:15:02 PM (20 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-caps.php
r13450 r13531 125 125 * 126 126 * @since 1.6.0 127 * @since 12.0.0 Added mapping for `bp_view` capability. 127 128 * 128 129 * @see WP_User::has_cap() for description of the arguments passed to the … … 137 138 */ 138 139 function bp_map_meta_caps( $caps, $cap, $user_id, $args ) { 140 141 switch ( $cap ) { 142 case 'bp_view' : 143 $caps = array( 'exist' ); 144 if ( ! $user_id ) { 145 146 // A BuddyPress component ID may be optionally passed with the `bp_view` check. 147 $component = isset( $args['bp_component'] ) ? $args['bp_component'] : ''; 148 149 if ( 'members' === bp_get_community_visibility( $component ) ) { 150 $caps = array( 'do_not_allow' ); 151 } 152 } 153 break; 154 } 139 155 140 156 /**
Note: See TracChangeset
for help on using the changeset viewer.