bp_activity_screen_notification_settings

Add activity notifications settings to the notifications settings page.

Description

bp_activity_screen_notification_settings(); 

Usage

  1. if ( !function_exists( 'bp_activity_screen_notification_settings' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-activity/bp-activity-screens.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bp_activity_screen_notification_settings(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/bp-activity/bp-activity-screens.php  
  1. function bp_activity_screen_notification_settings() { 
  2.  
  3. if ( ! $mention = bp_get_user_meta( bp_displayed_user_id(), 'notification_activity_new_mention', true ) ) { 
  4. $mention = 'yes'; 
  5.  
  6. if ( ! $reply = bp_get_user_meta( bp_displayed_user_id(), 'notification_activity_new_reply', true ) ) { 
  7. $reply = 'yes'; 
  8.  
  9. ?> 
  10.  
  11. <table class="notification-settings" id="activity-notification-settings"> 
  12. <thead> 
  13. <tr> 
  14. <th class="icon"> </th> 
  15. <th class="title"><?php _e( 'Activity', buddypress ) ?></th> 
  16. <th class="yes"><?php _e( 'Yes', buddypress ) ?></th> 
  17. <th class="no"><?php _e( 'No', buddypress )?></th> 
  18. </tr> 
  19. </thead> 
  20.  
  21. <tbody> 
  22. <?php if ( bp_activity_do_mentions() ) : ?> 
  23. <tr id="activity-notification-settings-mentions"> 
  24. <td> </td> 
  25. <td><?php printf( __( 'A member mentions you in an update using "@%s"', buddypress ), bp_core_get_username( bp_displayed_user_id() ) ) ?></td> 
  26. <td class="yes"><input type="radio" name="notifications[notification_activity_new_mention]" id="notification-activity-new-mention-yes" value="yes" <?php checked( $mention, 'yes', true ) ?>/><label for="notification-activity-new-mention-yes" class="bp-screen-reader-text"><?php 
  27. /** translators: accessibility text */ 
  28. _e( 'Yes, send email', buddypress ); 
  29. ?></label></td> 
  30. <td class="no"><input type="radio" name="notifications[notification_activity_new_mention]" id="notification-activity-new-mention-no" value="no" <?php checked( $mention, 'no', true ) ?>/><label for="notification-activity-new-mention-no" class="bp-screen-reader-text"><?php 
  31. /** translators: accessibility text */ 
  32. _e( 'No, do not send email', buddypress ); 
  33. ?></label></td> 
  34. </tr> 
  35. <?php endif; ?> 
  36.  
  37. <tr id="activity-notification-settings-replies"> 
  38. <td> </td> 
  39. <td><?php _e( "A member replies to an update or comment you've posted", buddypress ) ?></td> 
  40. <td class="yes"><input type="radio" name="notifications[notification_activity_new_reply]" id="notification-activity-new-reply-yes" value="yes" <?php checked( $reply, 'yes', true ) ?>/><label for="notification-activity-new-reply-yes" class="bp-screen-reader-text"><?php 
  41. /** translators: accessibility text */ 
  42. _e( 'Yes, send email', buddypress ); 
  43. ?></label></td> 
  44. <td class="no"><input type="radio" name="notifications[notification_activity_new_reply]" id="notification-activity-new-reply-no" value="no" <?php checked( $reply, 'no', true ) ?>/><label for="notification-activity-new-reply-no" class="bp-screen-reader-text"><?php 
  45. /** translators: accessibility text */ 
  46. _e( 'No, do not send email', buddypress ); 
  47. ?></label></td> 
  48. </tr> 
  49.  
  50. <?php 
  51.  
  52. /** 
  53. * Fires inside the closing </tbody> tag for activity screen notification settings. 
  54. * @since 1.2.0 
  55. */ 
  56. </tbody> 
  57. </table> 
  58.  
  59. <?php