Changeset 12945
- Timestamp:
- 05/10/2021 03:07:41 PM (3 years ago)
- Location:
- trunk/src/bp-members
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-members/bp-members-adminbar.php
r12924 r12945 194 194 } 195 195 196 if ( is_user_logged_in() && bp_get_members_invitations_allowed() && ( bp_current_user_can( 'bp_members_send_invitation' ) || bp_members_invitations_user_has_sent_invites()) ) {196 if ( bp_current_user_can( 'bp_members_invitations_view_screens' ) ) { 197 197 $bp = buddypress(); 198 198 $invitations_link = trailingslashit( bp_loggedin_user_domain() . bp_get_members_invitations_slug() ); … … 210 210 ); 211 211 212 if ( bp_current_user_can( 'bp_members_ send_invitation' ) ) {212 if ( bp_current_user_can( 'bp_members_invitations_view_send_screen' ) ) { 213 213 $wp_admin_bar->add_node( 214 214 array( … … 216 216 'parent' => $bp->my_account_menu_id . '-invitations', 217 217 'title' => __( 'Send Invites', 'buddypress' ), 218 'href' => $invitations_link ,218 'href' => $invitations_link . 'send-invites/', 219 219 'meta' => array( 220 220 'class' => 'ab-sub-secondary' -
trunk/src/bp-members/bp-members-filters.php
r12930 r12945 150 150 151 151 case 'bp_members_send_invitation': 152 if ( bp_get_members_invitations_allowed() ) {152 if ( is_user_logged_in() && bp_get_members_invitations_allowed() ) { 153 153 $retval = true; 154 154 } … … 167 167 } 168 168 } 169 break; 170 171 case 'bp_members_invitations_view_screens': 172 $retval = bp_get_members_invitations_allowed() && ( bp_user_can( $user_id, 'bp_members_send_invitation' ) || bp_members_invitations_user_has_sent_invites( $user_id ) ); 173 break; 174 175 case 'bp_members_invitations_view_send_screen': 176 $retval = is_user_logged_in() && bp_get_members_invitations_allowed(); 169 177 break; 170 178 } -
trunk/src/bp-members/bp-members-invitations.php
r12923 r12945 16 16 } 17 17 18 $user_has_access = bp_user_has_access(); 19 $user_can_send = bp_user_can( bp_displayed_user_id(), 'bp_members_send_invitation' ); 20 $user_has_invites = bp_members_invitations_user_has_sent_invites( bp_displayed_user_id() ); 18 $user_has_access = bp_user_has_access(); 19 $default_subnav_slug = ( bp_is_my_profile() && bp_user_can( bp_displayed_user_id(), 'bp_members_invitations_view_send_screen' ) ) ? 'send-invites' : 'list-invites'; 21 20 22 21 /* Add 'Invitations' to the main user profile navigation */ … … 27 26 'position' => 80, 28 27 'screen_function' => 'members_screen_send_invites', 29 'default_subnav_slug' => ( $user_can_send && bp_is_my_profile() ) ? 'send-invites' : 'list-invites',30 'show_for_displayed_user' => $user_has_access && ( $user_can_send || $user_has_invites)28 'default_subnav_slug' => $default_subnav_slug, 29 'show_for_displayed_user' => $user_has_access && bp_user_can( bp_displayed_user_id(), 'bp_members_invitations_view_screens' ) 31 30 ) 32 31 ); … … 43 42 'screen_function' => 'members_screen_send_invites', 44 43 'position' => 10, 45 'user_has_access' => $user_has_access && $user_can_send && bp_is_my_profile()44 'user_has_access' => $user_has_access && bp_is_my_profile() && bp_user_can( bp_displayed_user_id(), 'bp_members_invitations_view_send_screen' ) 46 45 ) 47 46 ); … … 55 54 'screen_function' => 'members_screen_list_sent_invites', 56 55 'position' => 20, 57 'user_has_access' => $user_has_access && ( $user_can_send || $user_has_invites)56 'user_has_access' => $user_has_access && bp_user_can( bp_displayed_user_id(), 'bp_members_invitations_view_screens' ) 58 57 ) 59 58 );
Note: See TracChangeset
for help on using the changeset viewer.