- Timestamp:
- 11/25/2021 12:30:33 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-templates/bp-nouveau/includes/groups/functions.php
r13108 r13156 102 102 return apply_filters( 'bp_nouveau_groups_disallow_all_members_invites', $default ); 103 103 } 104 105 /** 106 * Activate the Groups invitations feature if any member can be invited. 107 * 108 * @since 10.0.0 109 * 110 * @param bool True if any member can be invited. False otherwise. 111 */ 112 function bp_nouveau_is_groups_invitations_active() { 113 return ! bp_nouveau_groups_disallow_all_members_invites(); 114 } 115 add_filter( 'bp_is_groups_invitations_active', 'bp_nouveau_is_groups_invitations_active' ); 104 116 105 117 /** … … 311 323 312 324 /** 313 * @since 3.0.0 325 * Rename the Group invite step. 326 * 327 * @since 3.0.0 328 * @since 10.0.0 The function is no more creating a Group invite step. 329 * 330 * @param array $steps The Group create steps. 331 * @return array The Group create steps. 314 332 */ 315 333 function bp_nouveau_group_invites_create_steps( $steps = array() ) { 316 if ( bp_is_active( 'friends' ) && isset( $steps['group-invites'] ) ) { 317 // Simply change the name 334 if ( isset( $steps['group-invites'] ) ) { 318 335 $steps['group-invites']['name'] = _x( 'Invite', 'Group invitations menu title', 'buddypress' ); 319 return $steps; 320 } 321 322 // Add the create step if friends component is not active 323 $steps['group-invites'] = array( 324 'name' => _x( 'Invite', 'Group invitations menu title', 'buddypress' ), 325 'position' => 30, 326 ); 336 } 327 337 328 338 return $steps; … … 330 340 331 341 /** 332 * @since 3.0.0 342 * Rename the Group Invites nav. 343 * 344 * @since 3.0.0 345 * @since 10.0.0 The function is no longer creating a Group invite nav. 333 346 */ 334 347 function bp_nouveau_group_setup_nav() { … … 337 350 } 338 351 339 // Simply change the name 340 if ( bp_is_active( 'friends' ) ) { 352 if ( bp_is_active( 'groups', 'invitations' ) ) { 341 353 $bp = buddypress(); 342 354 … … 346 358 bp_get_current_group_slug() 347 359 ); 348 349 // Create the Subnav item for the group350 } else {351 $current_group = groups_get_current_group();352 $group_link = bp_get_group_permalink( $current_group );353 354 bp_core_new_subnav_item( array(355 'name' => _x( 'Invite', 'Group invitations menu title', 'buddypress' ),356 'slug' => 'send-invites',357 'parent_url' => $group_link,358 'parent_slug' => $current_group->slug,359 'screen_function' => 'groups_screen_group_invite',360 'item_css_id' => 'invite',361 'position' => 70,362 'user_has_access' => $current_group->user_has_access,363 'no_access_url' => $group_link,364 ) );365 360 } 366 361 }
Note: See TracChangeset
for help on using the changeset viewer.