If what posted is all the code you are using, you unsetting the value from the retreved array using unset
, but then you don’t save again the array on database:
add_action( 'delete_user', 'forum_remove_deleted_user' );
function forum_remove_deleted_user($user_id) {
$user_obj = get_userdata($user_id);
$subscbr_email = $user_obj->user_email;
if( ! empty( $subscbr_email ) ) {
$list = (array) get_option('mf_forum_subscribers_1');
if( ! empty($list) && ( false !== array_search($subscbr_email, $list) ) ) {
$key = array_search( $subscbr_email, $list );
unset( $list[$key] );
update_option('mf_forum_subscribers_1', $list); // you miss this part
}
}
}
For sake of semplicity I removed the dependency from is_subscribed
function that is unneeded here.