Changeset 14125
- Timestamp:
- 09/23/2025 02:14:55 PM (3 months ago)
- File:
-
- 1 edited
-
branches/14.0/src/bp-core/bp-core-functions.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/14.0/src/bp-core/bp-core-functions.php
r14103 r14125 4578 4578 // Unsubscribe. 4579 4579 $meta_key = $emails[ $raw_email_type ]['unsubscribe']['meta_key']; 4580 bp_update_user_meta( $raw_user_id, $meta_key, 'no' ); 4580 4581 if ( 'no' !== bp_get_user_meta( $raw_user_id, $meta_key, true ) ) { 4582 bp_update_user_meta( $raw_user_id, $meta_key, 'no' ); 4583 } 4581 4584 4582 4585 $result_msg = $emails[ $raw_email_type ]['unsubscribe']['message']; 4583 $unsub_msg = __( 'You can change this or any other email notification preferences in your email settings.', 'buddypress' ); 4586 4587 if ( bp_is_active( 'settings' ) ) { 4588 $unsub_msg = __( 'You can change this or any other email notification preferences in your email settings.', 'buddypress' ); 4589 } else { 4590 $unsub_msg = ''; 4591 } 4584 4592 } 4585 4593 … … 4593 4601 4594 4602 // Template notices are only displayed on BP pages. 4595 bp_core_add_message( $message ); 4596 bp_core_redirect( bp_members_get_user_url( $raw_user_id ) ); 4603 if ( is_user_logged_in() ) { 4604 bp_core_add_message( $message ); 4605 bp_core_redirect( bp_members_get_user_url( $raw_user_id ) ); 4606 } else { 4607 wp_die( 4608 sprintf( '%1$s <a href="%2$s">%3$s</a>', esc_html( $result_msg ), esc_url( $redirect_to ), esc_html( $unsub_msg ) ), 4609 esc_html( $unsub_msg ), 4610 array( 4611 'link_url' => esc_url( home_url() ), 4612 'link_text' => esc_html__( 'Go to website\'s home page.', 'buddypress' ), 4613 ) 4614 ); 4615 } 4597 4616 4598 4617 exit;
Note: See TracChangeset
for help on using the changeset viewer.