2 added 43 characters in body
source | link

In Edit Profile link append destination parameter like:

if(user_is_anonymous()){    
  $editlink = l(t('Edit Profile'), 'user/login', array('query' => array('destination' => 'user/UID/edit')));
}

Then after login, it will redirect to profile edit page.

In Edit Profile link append destination parameter like:

$editlink = l(t('Edit Profile'), 'user/login', array('query' => array('destination' => 'user/UID/edit')));

Then after login, it will redirect to profile edit page.

In Edit Profile link append destination parameter like:

if(user_is_anonymous()){    
  $editlink = l(t('Edit Profile'), 'user/login', array('query' => array('destination' => 'user/UID/edit')));
}

Then after login, it will redirect to profile edit page.

1
source | link

In Edit Profile link append destination parameter like:

$editlink = l(t('Edit Profile'), 'user/login', array('query' => array('destination' => 'user/UID/edit')));

Then after login, it will redirect to profile edit page.