- Timestamp:
- 11/25/2021 12:30:33 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-groups/classes/class-bp-groups-component.php
r13144 r13156 111 111 */ 112 112 public function __construct() { 113 $features = array(); 114 if ( bp_is_active( 'friends' ) ) { 115 $features[] = 'invitations'; 116 } 117 113 118 parent::start( 114 119 'groups', … … 117 122 array( 118 123 'adminbar_myaccount_order' => 70, 119 'search_query_arg' => 'groups_search', 124 'search_query_arg' => 'groups_search', 125 'features' => $features, 120 126 ) 121 127 ); … … 393 399 } 394 400 395 // If friends component is active, add invitations.396 if ( bp_is_active( ' friends' ) ) {401 // If invitations are enabled, add invitations. 402 if ( bp_is_active( 'groups', 'invitations' ) ) { 397 403 $this->group_creation_steps['group-invites'] = array( 398 404 'name' => _x( 'Invites', 'Group screen nav', 'buddypress' ), … … 608 614 ); 609 615 610 // Add the Group Invites nav item. 611 $sub_nav[] = array( 612 'name' => __( 'Invitations', 'buddypress' ), 613 'slug' => 'invites', 614 'parent_url' => $groups_link, 615 'parent_slug' => $slug, 616 'screen_function' => 'groups_screen_group_invites', 617 'user_has_access' => $access, 618 'position' => 30 619 ); 616 if ( bp_is_active( 'groups', 'invitations' ) ) { 617 // Add the Group Invites nav item. 618 $sub_nav[] = array( 619 'name' => __( 'Invitations', 'buddypress' ), 620 'slug' => 'invites', 621 'parent_url' => $groups_link, 622 'parent_slug' => $slug, 623 'screen_function' => 'groups_screen_group_invites', 624 'user_has_access' => $access, 625 'position' => 30 626 ); 627 } 620 628 621 629 parent::setup_nav( $main_nav, $sub_nav ); … … 706 714 } 707 715 708 if ( bp_is_active( ' friends' ) && bp_groups_user_can_send_invites() ) {716 if ( bp_is_active( 'groups', 'invitations' ) ) { 709 717 $sub_nav[] = array( 710 718 'name' => _x( 'Send Invites', 'My Group screen nav', 'buddypress' ), … … 834 842 $groups_link = trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() ); 835 843 836 // Pending group invites.837 $count = groups_get_invite_count_for_user();838 844 $title = _x( 'Groups', 'My Account Groups', 'buddypress' ); 839 845 $pending = _x( 'No Pending Invites', 'My Account Groups sub nav', 'buddypress' ); 840 846 841 if ( $count ) { 842 $title = sprintf( 843 /* translators: %s: Group invitation count for the current user */ 844 _x( 'Groups %s', 'My Account Groups nav', 'buddypress' ), 845 '<span class="count">' . bp_core_number_format( $count ) . '</span>' 846 ); 847 848 $pending = sprintf( 849 /* translators: %s: Group invitation count for the current user */ 850 _x( 'Pending Invites %s', 'My Account Groups sub nav', 'buddypress' ), 851 '<span class="count">' . bp_core_number_format( $count ) . '</span>' 852 ); 847 if ( bp_is_active( 'groups', 'invitations' ) ) { 848 // Pending group invites. 849 $count = groups_get_invite_count_for_user(); 850 if ( $count ) { 851 $title = sprintf( 852 /* translators: %s: Group invitation count for the current user */ 853 _x( 'Groups %s', 'My Account Groups nav', 'buddypress' ), 854 '<span class="count">' . bp_core_number_format( $count ) . '</span>' 855 ); 856 857 $pending = sprintf( 858 /* translators: %s: Group invitation count for the current user */ 859 _x( 'Pending Invites %s', 'My Account Groups sub nav', 'buddypress' ), 860 '<span class="count">' . bp_core_number_format( $count ) . '</span>' 861 ); 862 } 853 863 } 854 864 … … 871 881 872 882 // Invitations. 873 $wp_admin_nav[] = array( 874 'parent' => 'my-account-' . $this->id, 875 'id' => 'my-account-' . $this->id . '-invites', 876 'title' => $pending, 877 'href' => trailingslashit( $groups_link . 'invites' ), 878 'position' => 30 879 ); 883 if ( bp_is_active( 'groups', 'invitations' ) ) { 884 $wp_admin_nav[] = array( 885 'parent' => 'my-account-' . $this->id, 886 'id' => 'my-account-' . $this->id . '-invites', 887 'title' => $pending, 888 'href' => trailingslashit( $groups_link . 'invites' ), 889 'position' => 30 890 ); 891 } 880 892 881 893 // Create a Group.
Note: See TracChangeset
for help on using the changeset viewer.