groups_allowed_invite_status

  • apply_filters( 'groups_allowed_invite_status', array( 'members', 'mods', 'admins' ) )

    Source Reference:

    • Component: BuddyPress :: bp-groups
      File: /bp-groups/bp-groups-actions.php :: Trac Source Line: 108
      				$group_status = 'hidden';
      
      			if ( !$bp->groups->new_group_id = groups_create_group( array( 'group_id' => $bp->groups->new_group_id, 'status' => $group_status, 'enable_forum' => $group_enable_forum ) ) ) {
      				bp_core_add_message( __( 'There was an error saving group details, please try again.', 'buddypress' ), 'error' );
      				bp_core_redirect( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create/step/' . $bp->groups->current_create_step . '/' );
      			}
      
      			// Set the invite status
      			// Checked against a whitelist for security
      			$allowed_invite_status = apply_filters( 'groups_allowed_invite_status', array( 'members', 'mods', 'admins' ) );
      			$invite_status	       = in_array( $_POST['group-invite-status'], (array)$allowed_invite_status ) ? $_POST['group-invite-status'] : 'members';
      
      			groups_update_groupmeta( $bp->groups->new_group_id, 'invite_status', $invite_status );
      		}
      
      		if ( 'group-invites' == $bp->groups->current_create_step )
      			groups_send_invites( $bp->loggedin_user->id, $bp->groups->new_group_id );
      
      		do_action( 'groups_create_group_step_save_' . $bp->groups->current_create_step );
      		do_action( 'groups_create_group_step_complete' ); // Mostly for clearing cache on a generic action name
      
    • Component: BuddyPress :: bp-groups
      File: /bp-groups/bp-groups-screens.php :: Trac Source Line: 517
      		// If the edit form has been submitted, save the edited details
      		if ( isset( $_POST['save'] ) ) {
      			$enable_forum   = ( isset($_POST['group-show-forum'] ) ) ? 1 : 0;
      
      			// Checked against a whitelist for security
      			$allowed_status = apply_filters( 'groups_allowed_status', array( 'public', 'private', 'hidden' ) );
      			$status         = ( in_array( $_POST['group-status'], (array)$allowed_status ) ) ? $_POST['group-status'] : 'public';
      
      			// Checked against a whitelist for security
      			$allowed_invite_status = apply_filters( 'groups_allowed_invite_status', array( 'members', 'mods', 'admins' ) );
      			$invite_status	       = in_array( $_POST['group-invite-status'], (array)$allowed_invite_status ) ? $_POST['group-invite-status'] : 'members';
      
      			// Check the nonce
      			if ( !check_admin_referer( 'groups_edit_group_settings' ) )
      				return false;
      
      			if ( !groups_edit_group_settings( $_POST['group-id'], $enable_forum, $status, $invite_status ) ) {
      				bp_core_add_message( __( 'There was an error updating group settings, please try again.', 'buddypress' ), 'error' );
      			} else {
      				bp_core_add_message( __( 'Group settings were successfully updated.', 'buddypress' ) );
      

Comments are closed.