<?php
function add_email_spec_meta( $arr ) {
if( !bb_is_user_logged_in() || bb_current_user_can( 'edit_users' ) )
return $arr;
if( bb_get_location() != 'profile-page' || stripos( $_SERVER[ 'QUERY_STRING' ], 'tab=edit' ) !== false )
return $arr;
$arr['email_spec'] = $arr['user_email'];
global $wp_users_object;
$id = bb_get_current_user_info( 'id' );
$meta_key = 'email_spec';
$meta_value = bb_get_usermeta( $id, 'user_email' );
$wp_users_object->update_meta( compact( 'id', 'meta_key', 'meta_value' ) );
return $arr;
}
add_filter( 'get_profile_info_keys', 'add_email_spec_meta' );
?>