BP_REST_Account_Settings_Options_Endpoint::update_invites_fields( WP_REST_Request $request )
Update Invites fields “Group Invites”.
Description
Parameters
- $request
-
(Required) Full details about the request.
Return
(array|bool|void)
Source
File: bp-settings/classes/class-bp-rest-account-settings-options-endpoint.php
public function update_invites_fields( $request ) { $post_fields = $request->get_param( 'fields' ); add_filter( 'bp_displayed_user_id', array( $this, 'bp_rest_get_displayed_user' ), 999 ); // Nonce check. if ( empty( $post_fields['account-group-invites-preferences'] ) ) { bp_delete_user_meta( bp_displayed_user_id(), '_bp_nouveau_restrict_invites_to_friends' ); } else { bp_update_user_meta( bp_displayed_user_id(), '_bp_nouveau_restrict_invites_to_friends', (int) $post_fields['account-group-invites-preferences'] ); } do_action( 'bp_rest_invites_settings_after_save', $post_fields ); remove_filter( 'bp_displayed_user_id', array( $this, 'bp_rest_get_displayed_user' ), 999 ); return array( 'error' => false, 'notice' => false, ); }
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.