Changeset 7543
- Timestamp:
- 11/09/2013 01:59:32 PM (11 years ago)
- Location:
- trunk/bp-notifications
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-notifications/bp-notifications-functions.php
r7537 r7543 84 84 } 85 85 86 return BP_Notifications_Notification::delete( $id ); 86 return BP_Notifications_Notification::delete( array( 'id' => $id ) ); 87 } 88 89 /** 90 * Mark notification read/unread for a user by ID. 91 * 92 * Used when clearing out notifications for a specific notification item. 93 * 94 * @since BuddyPress (1.9.0) 95 * 96 * @param int $user_id ID of the user whose notifications are being deleted. 97 * @param int $is_new 0 for read, 1 for unread 98 * @return bool True on success, false on failure. 99 */ 100 function bp_notifications_mark_notification( $id, $is_new = false ) { 101 if ( ! bp_notifications_check_notification_access( bp_loggedin_user_id(), $id ) ) { 102 return false; 103 } 104 105 return BP_Notifications_Notification::update( 106 array( 'is_new' => $is_new ), 107 array( 'id' => $id ) 108 ); 87 109 } 88 110 -
trunk/bp-notifications/bp-notifications-loader.php
r7521 r7543 43 43 public function includes( $includes = array() ) { 44 44 $includes = array( 45 'actions', 45 46 'classes', 46 47 'screens', -
trunk/bp-notifications/bp-notifications-template.php
r7540 r7543 661 661 function bp_get_the_notification_mark_read_link() { 662 662 663 // Get the URL with nonce, action, and id 664 $url = wp_nonce_url( add_query_arg( array( 'action' => 'read', 'notification_id' => bp_get_the_notification_id() ), bp_get_notifications_unread_permalink() ), 'bp_notification_mark_read_' . bp_get_the_notification_id() ); 665 666 // Start the output buffer 663 667 ob_start(); ?> 664 668 665 <a href="<?php echo wp_nonce_url( add_query_arg( array( 'action' => 'read', 'id' => bp_get_the_notification_id() ), bp_get_notifications_unread_permalink() ), 'bp_notification_' . bp_get_the_notification_id()); ?>" class="mark-read primary"><?php _e( 'Read', 'buddypress' ); ?></a>669 <a href="<?php echo esc_url( $url ); ?>" class="mark-read primary"><?php _e( 'Read', 'buddypress' ); ?></a> 666 670 667 671 <?php $retval = ob_get_clean(); … … 687 691 function bp_get_the_notification_mark_unread_link() { 688 692 693 // Get the URL with nonce, action, and id 694 $url = wp_nonce_url( add_query_arg( array( 'action' => 'unread', 'notification_id' => bp_get_the_notification_id() ), bp_get_notifications_read_permalink() ), 'bp_notification_mark_unread_' . bp_get_the_notification_id() ); 695 696 // Start the output buffer 689 697 ob_start(); ?> 690 698 691 <a href="<?php echo wp_nonce_url( add_query_arg( array( 'action' => 'unread', 'id' => bp_get_the_notification_id() ), bp_get_notifications_read_permalink() ), 'bp_notification_' . bp_get_the_notification_id()); ?>" class="mark-unread primary"><?php _e( 'Unread', 'buddypress' ); ?></a>699 <a href="<?php echo esc_url( $url ); ?>" class="mark-unread primary"><?php _e( 'Unread', 'buddypress' ); ?></a> 692 700 693 701 <?php $retval = ob_get_clean(); … … 746 754 } 747 755 756 // Get the URL with nonce, action, and id 757 $url = wp_nonce_url( add_query_arg( array( 'action' => 'delete', 'notification_id' => bp_get_the_notification_id() ), $link ), 'bp_notification_delete_' . bp_get_the_notification_id() ); 758 748 759 // Start the output buffer 749 760 ob_start(); ?> 750 761 751 <a href="<?php echo wp_nonce_url( add_query_arg( array( 'action' => 'delete', 'id' => bp_get_the_notification_id() ), $link ), 'bp_notification_' . bp_get_the_notification_id()); ?>" class="delete secondary"><?php _e( 'Delete', 'buddypress' ); ?></a>762 <a href="<?php echo esc_url( $url ); ?>" class="delete secondary"><?php _e( 'Delete', 'buddypress' ); ?></a> 752 763 753 764 <?php $retval = ob_get_clean();
Note: See TracChangeset
for help on using the changeset viewer.