Changeset 12917
- Timestamp:
- 04/28/2021 11:50:09 PM (3 years ago)
- Location:
- trunk/src
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-members/bp-members-filters.php
r10711 r12917 128 128 } 129 129 add_filter( 'edit_profile_url', 'bp_members_edit_profile_url', 10, 3 ); 130 131 /** 132 * Filter the bp_user_can value to determine what the user can do in the members component. 133 * 134 * @since 8.0.0 135 * 136 * @param bool $retval Whether or not the current user has the capability. 137 * @param int $user_id 138 * @param string $capability The capability being checked for. 139 * @param int $site_id Site ID. Defaults to the BP root blog. 140 * @param array $args Array of extra arguments passed. 141 * 142 * @return bool 143 */ 144 function bp_members_user_can_filter( $retval, $user_id, $capability, $site_id, $args = array() ) { 145 146 switch ( $capability ) { 147 case 'bp_members_manage_membership_requests': 148 $retval = bp_user_can( $user_id, 'bp_moderate' ); 149 break; 150 151 case 'bp_members_send_invitation': 152 if ( bp_get_members_invitations_allowed() ) { 153 $retval = true; 154 } 155 break; 156 157 case 'bp_members_receive_invitation': 158 if ( bp_get_members_invitations_allowed() ) { 159 $retval = true; 160 // The invited user must not already be a member of the network. 161 if ( empty( $args['invitee_email'] ) || false !== get_user_by( 'email', $args['invitee_email'] ) ) { 162 $retval = false; 163 } 164 // The invited user must not have opted out from being contacted from this site. 165 if ( bp_user_has_opted_out( $args['invitee_email'] ) ) { 166 $retval = false; 167 } 168 } 169 break; 170 } 171 172 return $retval; 173 } 174 add_filter( 'bp_user_can', 'bp_members_user_can_filter', 10, 5 ); -
trunk/src/bp-members/classes/class-bp-members-component.php
r12898 r12917 40 40 array( 41 41 'adminbar_myaccount_order' => 20, 42 'search_query_arg' => 'members_search', 42 'search_query_arg' => 'members_search', 43 'features' => array( 'invitations' ) 43 44 ) 44 45 ); … … 65 66 'widgets', 66 67 'cache', 68 'invitations', 67 69 ); 68 70 … … 234 236 $bp->profile->id = 'profile'; 235 237 } 238 239 /** Network Invitations ************************************************** 240 */ 241 242 $bp->members->invitations = new stdClass; 236 243 } 237 244 -
trunk/src/class-buddypress.php
r12899 r12917 623 623 'BP_REST_Attachments_Member_Cover_Endpoint' => 'members', 624 624 'BP_REST_Signup_Endpoint' => 'members', 625 'BP_Members_Invitation_Manager' => 'members', 625 626 626 627 'BP_REST_Messages_Endpoint' => 'messages',
Note: See TracChangeset
for help on using the changeset viewer.