- Timestamp:
- 07/08/2021 05:23:19 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-templates/bp-nouveau/includes/messages/ajax.php
r12937 r12989 767 767 768 768 // Mark the active notice as closed. 769 $notice = BP_Messages_Notice::get_active(); 770 771 if ( ! empty( $notice->id ) ) { 772 $user_id = bp_loggedin_user_id(); 773 774 $closed_notices = bp_get_user_meta( $user_id, 'closed_notices', true ); 775 776 if ( empty( $closed_notices ) ) { 777 $closed_notices = array(); 778 } 779 780 // Add the notice to the array of the user's closed notices. 781 $closed_notices[] = (int) $notice->id; 782 bp_update_user_meta( $user_id, 'closed_notices', array_map( 'absint', array_unique( $closed_notices ) ) ); 783 769 $success = bp_messages_dismiss_sitewide_notice(); 770 771 if ( $success ) { 784 772 wp_send_json_success( array( 785 773 'feedback' => '<div class="bp-feedback info"><span class="bp-icon" aria-hidden="true"></span><p>' . __( 'Sitewide notice dismissed', 'buddypress' ) . '</p></div>', 786 774 'type' => 'success', 787 775 ) ); 788 } 789 } 776 } else { 777 wp_send_json_error( array( 778 'feedback' => '<div class="bp-feedback info"><span class="bp-icon" aria-hidden="true"></span><p>' . __( 'There was a problem dismissing that sitewide notice', 'buddypress' ) . '</p></div>', 779 'type' => 'error', 780 ) ); 781 } 782 }
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)