development of themes: custom field in the user profile that does not save data

I was trying to add a custom field to the word "Your profile" from wordpress. I did that, but when I enter any data and pulse update, the profile is updated. But the personalized entry remains empty even adding data before. I do not know why this happens. My code is.

add_author_role_field ($ user) function {
$ role = get_the_author_meta (& # 39; author_role & # 39 ;, $ user-> ID);
?>
    

<input type = "text" name = "author_role" value = ""> <? php } add_action (& # 39; show_user_profile & # 39 ;, & # 39; add_author_role_field & # 39;); add_action (& # 39; edit_user_profile & # 39 ;, & # 39; add_author_role_field & # 39;); add_action (& # 39; personal_options_update & # 39 ;, & # 39; crf_update_profile_fields & # 39;); add_action (& # 39; edit_user_profile_update & # 39 ;, & # 39; crf_update_profile_fields & # 39;); function crf_update_profile_fields ($ user_id) { if (! current_user_can (& # 39; edit_user & # 39 ;, $ user_id)) { false return; } yes (! empty ($ _POST['year_of_birth'] )) { update_user_meta ($ user_id, & # 39; author_role & # 39 ;, sanitize_text_field ($ _ POST['author_role'])); } }

So I'm trying to show it on the interface using this code.

echo get_the_author_meta (& # 39; author_role & # 39;);

I can not understand the problem. Thanks in advance