Changeset 14129
- Timestamp:
- 09/23/2025 07:56:30 PM (3 months ago)
- File:
-
- 1 edited
-
branches/12.0/src/bp-core/bp-core-functions.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/12.0/src/bp-core/bp-core-functions.php
r14108 r14129 4509 4509 // Unsubscribe. 4510 4510 $meta_key = $emails[ $raw_email_type ]['unsubscribe']['meta_key']; 4511 bp_update_user_meta( $raw_user_id, $meta_key, 'no' ); 4511 4512 if ( 'no' !== bp_get_user_meta( $raw_user_id, $meta_key, true ) ) { 4513 bp_update_user_meta( $raw_user_id, $meta_key, 'no' ); 4514 } 4512 4515 4513 4516 $result_msg = $emails[ $raw_email_type ]['unsubscribe']['message']; 4514 $unsub_msg = __( 'You can change this or any other email notification preferences in your email settings.', 'buddypress' ); 4517 4518 if ( bp_is_active( 'settings' ) ) { 4519 $unsub_msg = __( 'You can change this or any other email notification preferences in your email settings.', 'buddypress' ); 4520 } else { 4521 $unsub_msg = ''; 4522 } 4515 4523 } 4516 4524 … … 4524 4532 4525 4533 // Template notices are only displayed on BP pages. 4526 bp_core_add_message( $message ); 4527 bp_core_redirect( bp_members_get_user_url( $raw_user_id ) ); 4534 if ( is_user_logged_in() ) { 4535 bp_core_add_message( $message ); 4536 bp_core_redirect( bp_members_get_user_url( $raw_user_id ) ); 4537 } else { 4538 wp_die( 4539 sprintf( '%1$s <a href="%2$s">%3$s</a>', esc_html( $result_msg ), esc_url( $redirect_to ), esc_html( $unsub_msg ) ), 4540 esc_html( $unsub_msg ), 4541 array( 4542 'link_url' => esc_url( home_url() ), 4543 'link_text' => esc_html__( 'Go to website\'s home page.', 'buddypress' ), 4544 ) 4545 ); 4546 } 4528 4547 4529 4548 exit;
Note: See TracChangeset
for help on using the changeset viewer.