Add Members-related settings to the Settings > Notifications page.

Source Source

File: bp-members/bp-members-notifications.php

function members_screen_notification_settings() {

	// Bail early if invitations are not allowed--they are the only members notification so far.
	if ( ! bp_get_members_invitations_allowed () ) {

	if ( ! $allow_acceptance_emails = bp_get_user_meta( bp_displayed_user_id(), 'notification_members_invitation_accepted', true ) ) {
		$allow_acceptance_emails = 'yes';

	<table class="notification-settings" id="members-notification-settings">
				<th class="icon"></th>
				<th class="title"><?php _ex( 'Members', 'Member settings on notification settings page', 'buddypress' ) ?></th>
				<th class="yes"><?php _e( 'Yes', 'buddypress' ) ?></th>
				<th class="no"><?php _e( 'No', 'buddypress' )?></th>

			<tr id="members-notification-settings-invitation_accepted">
				<td><?php _ex( 'Someone accepts your membership invitation', 'Member settings on notification settings page', 'buddypress' ) ?></td>
				<td class="yes"><input type="radio" name="notifications[notification_members_invitation_accepted]" id="notification-members-invitation-accepted-yes" value="yes" <?php checked( $allow_acceptance_emails, 'yes', true ) ?>/><label for="notification-members-invitation-accepted-yes" class="bp-screen-reader-text"><?php
					/* translators: accessibility text */
					_e( 'Yes, send email', 'buddypress' );
				<td class="no"><input type="radio" name="notifications[notification_members_invitation_accepted]" id="notification-members-invitation-accepted-no" value="no" <?php checked( $allow_acceptance_emails, 'no', true ) ?>/><label for="notification-members-invitation-accepted-no" class="bp-screen-reader-text"><?php
					/* translators: accessibility text */
					_e( 'No, do not send email', 'buddypress' );


			 * Fires after the last table row on the members notification screen.
			 * @since 1.0.0
			do_action( 'members_screen_notification_settings' ); ?>



Top ↑

Changelog Changelog

Version Description
8.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.