NooTheme Premium WordPress Theme › Forums › JobMonster › Company auto register
- This topic has 8 replies, 2 voices, and was last updated 4 years, 6 months ago by dangdv.
-
AuthorPosts
-
4 years, 6 months ago #1174795
hey i was creating Company automatically after Employer register, using this code that you provided me , but yesterday we updated our theme and after that this code stopped working kindly look into this issue, thanks
add_action('noo_new_user_registered', function($user_id, $args){ if(Noo_Member::is_employer($user_id)){ $user_display_name = get_the_author_meta('display_name',$user_id); if(empty($user_display_name)){ $user_display_name = get_the_author_meta('user_login',$user_id); } $create_compay = Noo_Form_Handler::save_company(array( 'company_name' => $user_display_name, 'company_desc' => '', '_website' => '', '_googleplus' => '', '_twitter' => '', '_facebook' => '', '_linkedin' => '', '_instagram' => '', ),$user_id); } },10,2);
4 years, 6 months ago #1175180This reply has been marked as private.4 years, 6 months ago #1175204I see it still working, please check your site again.
best regards.
4 years, 6 months ago #1175215can you share any screenshot for that because when am registering employer its not registering company automatically for that employer , as you can see as well in text field of employer name its still showing userename/email instead of display name that we are saving(according to above code)
4 years, 6 months ago #1175217yes this code is working now , but the problem is now i want to save display name as a company not a email please tell me how to do that? thanks for rest
4 years, 6 months ago #1175240please suggest some solution for that
4 years, 6 months ago #1175245Please change custom code to
add_action('noo_new_user_registered', function($user_id, $args){ if(Noo_Member::is_employer($user_id)){ if(isset($args['display_name']) && !empty($args['display_name'])){ $user_display_name = $args['display_name']; }else{ $user_display_name = get_the_author_meta('user_login',$user_id); } $create_compay = Noo_Form_Handler::save_company(array( 'company_name' => $user_display_name, 'company_desc' => '', '_website' => '', '_googleplus' => '', '_twitter' => '', '_facebook' => '', '_linkedin' => '', '_instagram' => '', ),$user_id); } },10,2);
Then check your site again.
best regards,
4 years, 6 months ago #1176019Thanks but still it not working for me , still its saving the email instead of Display name , kindly check that.
4 years, 6 months ago #1178077This reply has been marked as private. -
AuthorPosts
You must be logged in and have valid license to reply to this topic.