For the registration of our new users on speed-kini.de, we use the very cool Gravity Forms Plugin. It all worked quite fine until new users did not have a first name, last name or display name specified. I’ve had the hope that there will be an update, which may fix this problem, but there hasn’t been one yet. So I decided to fix it manually by updating the new WordPress user object:
Needed Action
Gravity forms provide gform_user_registered. It has the entry, feed, and user_id as parameters:

Custom Code
public static function userRegistered( $user_id, $feed, $entry, $user_pass ) { $firstName = $entry[ $feed['meta']['first_name'] ]; $lastName = $entry[ $feed['meta']['last_name'] ]; $userName = $entry[ $feed['meta']['username'] ]; // Fix registration $res = wp_update_user( array( 'ID' => $user_id, 'first_name' => $firstName, 'last_name' => $lastName, 'display_name' => $firstName . " " . $lastName ) ); }
This works fine for me 😎
51 comments
Selamlar, biz Bursa’da düğün, nişan ve kurumsal etkinlikler düzenleyen bir firmayız. Yaptığımız işleri Instagram’da paylaşıyoruz ama web sitemiz biraz atıl kalmıştı. “Bursa düğün organizasyon firmaları” aramasında görünür olmak istiyoruz. Aklıma şöyle bir fikir geldi: Sitemizin blogunda “Bursa’daki En İyi 10 Kır Düğünü Mekanı”, “Şirket Lansmanı İçin Organizasyon Fikirleri” gibi listeler ve rehberler yayınlayabiliriz. Bu içerikler hem evlenecek çiftlerin hem de şirketlerin ilgisini çekecektir. Bursa SEO sadece teknik bir iş değil, aynı zamanda yaratıcılık da gerektiriyormuş.