| Server IP : 172.67.147.195 / Your IP : 216.73.216.142 Web Server : Apache/2 System : Linux hosting8537.lvs 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 User : mienphi ( 1014) PHP Version : 8.2.14 Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/mienphi/public_html/wp-content/plugins/buddypress/bp-settings/actions/ |
Upload File : |
<?php
/**
* Settings: Email notifications action handler.
*
* @package BuddyPress
* @subpackage SettingsActions
* @since 3.0.0
*/
/**
* Handles the changing and saving of user notification settings.
*
* @since 1.6.0
*/
function bp_settings_action_notifications() {
if ( ! bp_is_post_request() ) {
return;
}
// Bail if no submit action.
if ( ! isset( $_POST['submit'] ) ) {
return;
}
// Bail if not in settings.
if ( ! bp_is_settings_component() || ! bp_is_current_action( 'notifications' ) ) {
return;
}
// 404 if there are any additional action variables attached
if ( bp_action_variables() ) {
bp_do_404();
return;
}
check_admin_referer( 'bp_settings_notifications' );
bp_settings_update_notification_settings( bp_displayed_user_id(), (array) $_POST['notifications'] );
// Switch feedback for super admins.
if ( bp_is_my_profile() ) {
bp_core_add_message( __( 'Your notification settings have been saved.', 'buddypress' ), 'success' );
} else {
bp_core_add_message( __( "This user's notification settings have been saved.", 'buddypress' ), 'success' );
}
/**
* Fires after the notification settings have been saved, and before redirect.
*
* @since 1.5.0
*/
do_action( 'bp_core_notification_settings_after_save' );
bp_core_redirect(
bp_displayed_user_url( bp_members_get_path_chunks( array( bp_get_settings_slug(), 'notifications' ) ) )
);
}
add_action( 'bp_actions', 'bp_settings_action_notifications' );