bp_nouveau_groups_localize_scripts( array $params = array() )
Localize the strings needed for the Group’s Invite UI
Description
Parameters
- $params
-
(Optional) Associative array containing the JS Strings needed by scripts
Default value: array()
Return
(array) The same array with specific strings for the Group's Invite UI if needed.
Source
File: bp-templates/bp-nouveau/includes/groups/functions.php
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 | function bp_nouveau_groups_localize_scripts( $params = array () ) { if ( ! bp_is_group_invites() && ! ( bp_is_group_create() && bp_is_group_creation_step( 'group-invites' ) ) ) { return $params ; } $show_pending = bp_group_has_invites( array ( 'user_id' => 'any' ) ) && ! bp_is_group_create(); // Init the Group invites nav $invites_nav = array ( 'members' => array ( 'id' => 'members' , 'caption' => __( 'All Members' , 'buddyboss' ), 'order' => 5, ), 'invited' => array ( 'id' => 'invited' , 'caption' => __( 'Pending Invites' , 'buddyboss' ), 'order' => 90, 'hide' => (int) ! $show_pending , ), 'invites' => array ( 'id' => 'invites' , 'caption' => __( 'Send Invites' , 'buddyboss' ), 'order' => 100, 'hide' => 1, 'href' => '#send-invites-editor' , ), ); if ( bp_is_active( 'friends' ) ) { $invites_nav [ 'friends' ] = array ( 'id' => 'friends' , 'caption' => __( 'My Connections' , 'buddyboss' ), 'order' => 0, ); if ( true === bp_nouveau_groups_disallow_all_members_invites() ) { unset( $invites_nav [ 'members' ] ); } } $params [ 'group_invites' ] = array ( 'nav' => bp_sort_by_key( $invites_nav , 'order' , 'num' ), 'loading' => __( 'Loading members. Please wait.' , 'buddyboss' ), 'invites_form' => __( 'Use the "Send" button to send your invite or the "Cancel" button to abort.' , 'buddyboss' ), 'invites_form_reset' => __( 'Group invitations cleared. Please use one of the available tabs to select members to invite.' , 'buddyboss' ), 'invites_sending' => __( 'Sending group invitations. Please wait.' , 'buddyboss' ), 'removeUserInvite' => __( 'Cancel invitation %s' , 'buddyboss' ), 'group_id' => ! bp_get_current_group_id() ? bp_get_new_group_id() : bp_get_current_group_id(), 'is_group_create' => bp_is_group_create(), 'nonces' => array ( 'uninvite' => wp_create_nonce( 'groups_invite_uninvite_user' ), 'send_invites' => wp_create_nonce( 'groups_send_invites' ) ), ); return $params ; } |
Changelog
Version | Description |
---|---|
BuddyPress 3.0.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.