bp_gifts_screen_notification_settings

Bp_example_screen_notification_settings().

Description

bp_gifts_screen_notification_settings(); 

Adds notification settings for the component, so that a user can turn off email

notifications set on specific component actions.


Usage

  1. if ( !function_exists( 'bp_gifts_screen_notification_settings' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress-gifts-latest-2014/includes/bp-gifts-core.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bp_gifts_screen_notification_settings(); 
  7.  

Defined (1)

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

/includes/bp-gifts-core.php  
  1. function bp_gifts_screen_notification_settings() { 
  2.  
  3. global $current_user; 
  4.  
  5.  
  6. ?> 
  7.  
  8. <table class="notification-settings" id="bp-gifts-notification-settings"> 
  9. <thead> 
  10. <tr> 
  11.  
  12. <th class="icon"></th> 
  13.  
  14. <th class="title"><?php _e( 'Gifts', 'bp-gifts' ) ?></th> 
  15.  
  16. <th class="yes"><?php _e( 'Yes', 'bp-gifts' ) ?></th> 
  17.  
  18. <th class="no"><?php _e( 'No', 'bp-gifts' )?></th> 
  19.  
  20. </tr> 
  21. </thead> 
  22. <tbody> 
  23. <tr> 
  24.  
  25. <td></td> 
  26.  
  27. <td><?php _e( 'You received new gifts', 'bp-gifts' ) ?></td> 
  28.  
  29. <td class="yes"><input type="radio" name="notifications[notification_gifts_received]" value="yes" <?php if ( !get_usermeta( $bp->loggedin_user->id, 'notification_gifts_received') || 'yes' == get_usermeta( $bp->loggedin_user->id, 'notification_gifts_received') ) { ?>checked="checked" <?php } ?>/></td> 
  30.  
  31. <td class="no"><input type="radio" name="notifications[notification_gifts_received]" value="no" <?php if ( get_usermeta( $bp->loggedin_user->id, 'notification_gifts_received') == 'no' ) { ?>checked="checked" <?php } ?>/></td> 
  32.  
  33. </tr> 
  34. </tbody> 
  35.  
  36.  
  37. <?php do_action( 'bp_gifts_notification_settings' ); ?> 
  38.  
  39. </table> 
  40.  
  41. <?php 
  42.