friends_screen_notification_settings()

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

Description

Source

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

247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
function friends_screen_notification_settings() {
 
    if ( !$send_requests = bp_get_user_meta( bp_displayed_user_id(), 'notification_friends_friendship_request', true ) )
        $send_requests   = 'yes';
 
    if ( !$accept_requests = bp_get_user_meta( bp_displayed_user_id(), 'notification_friends_friendship_accepted', true ) )
        $accept_requests = 'yes'; ?>
 
    <table class="notification-settings" id="friends-notification-settings">
        <thead>
            <tr>
                <th class="icon"></th>
                <th class="title"><?php _e( 'Connections', 'buddyboss' ) ?></th>
                <th class="yes"><?php _e( 'Yes', 'buddyboss' ) ?></th>
                <th class="no"><?php _e( 'No', 'buddyboss' )?></th>
            </tr>
        </thead>
 
        <tbody>
            <tr id="friends-notification-settings-request">
                <td></td>
                <td><?php _e( 'A member invites you to connect', 'buddyboss' ) ?></td>
                <td class="yes"><input type="radio" name="notifications[notification_friends_friendship_request]" id="notification-friends-friendship-request-yes" value="yes" <?php checked( $send_requests, 'yes', true ) ?>/><label for="notification-friends-friendship-request-yes" class="bp-screen-reader-text"><?php
                    /* translators: accessibility text */
                    _e( 'Yes, send email', 'buddyboss' );
                ?></label></td>
                <td class="no"><input type="radio" name="notifications[notification_friends_friendship_request]" id="notification-friends-friendship-request-no" value="no" <?php checked( $send_requests, 'no', true ) ?>/><label for="notification-friends-friendship-request-no" class="bp-screen-reader-text"><?php
                    /* translators: accessibility text */
                    _e( 'No, do not send email', 'buddyboss' );
                ?></label></td>
            </tr>
            <tr id="friends-notification-settings-accepted">
                <td></td>
                <td><?php _e( 'A member accepts your connection request', 'buddyboss' ) ?></td>
                <td class="yes"><input type="radio" name="notifications[notification_friends_friendship_accepted]" id="notification-friends-friendship-accepted-yes" value="yes" <?php checked( $accept_requests, 'yes', true ) ?>/><label for="notification-friends-friendship-accepted-yes" class="bp-screen-reader-text"><?php
                    /* translators: accessibility text */
                    _e( 'Yes, send email', 'buddyboss' );
                ?></label></td>
                <td class="no"><input type="radio" name="notifications[notification_friends_friendship_accepted]" id="notification-friends-friendship-accepted-no" value="no" <?php checked( $accept_requests, 'no', true ) ?>/><label for="notification-friends-friendship-accepted-no" class="bp-screen-reader-text"><?php
                    /* translators: accessibility text */
                    _e( 'No, do not send email', 'buddyboss' );
                ?></label></td>
            </tr>
 
            <?php
 
            /**
             * Fires after the last table row on the friends notification screen.
             *
             * @since BuddyPress 1.0.0
             */
            do_action( 'friends_screen_notification_settings' ); ?>
 
        </tbody>
    </table>
 
<?php
}

Changelog

Changelog
Version Description
BuddyPress 1.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.