messages_screen_notification_settings()
Render the markup for the Messages section of Settings > Notifications.
Description
Source
File: bp-messages/bp-messages-notifications.php
function messages_screen_notification_settings() {
if ( bp_action_variables() ) {
bp_do_404();
return;
}
if ( !$new_messages = bp_get_user_meta( bp_displayed_user_id(), 'notification_messages_new_message', true ) ) {
$new_messages = 'yes';
} ?>
<table class="notification-settings" id="messages-notification-settings">
<thead>
<tr>
<th class="icon"></th>
<th class="title"><?php _e( 'Messages', 'buddyboss' ) ?></th>
<th class="yes"><?php _e( 'Yes', 'buddyboss' ) ?></th>
<th class="no"><?php _e( 'No', 'buddyboss' )?></th>
</tr>
</thead>
<tbody>
<tr id="messages-notification-settings-new-message">
<td></td>
<td><?php _e( 'A member sends you a new message', 'buddyboss' ) ?></td>
<td class="yes"><input type="radio" name="notifications[notification_messages_new_message]" id="notification-messages-new-messages-yes" value="yes" <?php checked( $new_messages, 'yes', true ) ?>/><label for="notification-messages-new-messages-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_messages_new_message]" id="notification-messages-new-messages-no" value="no" <?php checked( $new_messages, 'no', true ) ?>/><label for="notification-messages-new-messages-no" class="bp-screen-reader-text"><?php
/* translators: accessibility text */
_e( 'No, do not send email', 'buddyboss' );
?></label></td>
</tr>
<?php
/**
* Fires inside the closing </tbody> tag for messages screen notification settings.
*
* @since BuddyPress 1.0.0
*/
do_action( 'messages_screen_notification_settings' ); ?>
</tbody>
</table>
<?php
}
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.