I am searching all over the internet but can't find how to add or update meta data after the user has activated their blog/site.
I want to add those one so that the user can see their additional meta/custom field in their profile page.
I have this code on my wp-signup.php file:
$signup_meta = array(
'organization_address'=>$_POST['organization_address'],
'organization_name'=>$_POST['organization_name'],
'organization_number'=>$_POST['organization_number'],
'organization_address'=>$_POST['organization_address'],
'organization_zip'=>$_POST['organization_zip'],
'organization_city'=>$_POST['organization_city'],
'organization_country'=>$_POST['organization_country'],
'first_name'=>$_POST['first_name'],
'last_name'=>$_POST['last_name'],
'phone'=>$_POST['phone'],
'lang_id' => 1,
'public' => $public
);
wpmu_signup_blog($domain, $path, $blog_title, $email, $email, $signup_meta);
add_action('user_register', 'custom_register_extra_fields');
add_action('wpmu_activate_user', 'stjert_register_user_meta', 10, 3);
$meta_defaults = apply_filters( 'signup_create_blog_meta', $signup_meta );
confirm_blog_signup($domain, $path, $blog_title, $email, $email, $signup_meta);
Then on my functions.php
file , I have this code:
add_action ( 'show_user_profile', 'my_show_extra_profile_fields' );
add_action ( 'edit_user_profile', 'my_show_extra_profile_fields' );
function my_show_extra_profile_fields ( $user )
{
<h3>Kontaktinformasjon</h3>
<table class="form-table">
<tr>
<th><label for="first_name">Fornavn:</label></th>
<td>
<input type="text" name="first_name" id="first_name" value="<?php echo esc_attr( get_the_author_meta( 'first_name', $user->ID ) ); ?>" class="regular-text" />
</td>
</tr>
<tr>
<th><label>Etternavn:</label></th>
<td>
<input type="text" name="last_name" id="last_name" value="<?php echo esc_attr( get_the_author_meta( 'last_name', $user->ID ) ); ?>" class="regular-text" />
</td>
</tr>
<tr>
<th><label>Telefon:</label></th>
<td>
<input type="text" name="phone" id="phone" value="<?php echo esc_attr( get_the_author_meta( 'phone', $user->ID ) ); ?>" class="regular-text" />
</td>
</tr>
</table>
I cut down the code because its too long.
When I go to the Profile Page(wp-admin), I don't see those custom fields/meta values that I had during registration, I was thinking that maybe it was not saved or whatever?
Any help on this? Please. I am really new to wordpress and the 'Wordpress way' is very difficult for me. Feels like very different from MVC frameworks.
Your help will be greatly appreciated!
Thanks!
PS: Here's my entire code of wp-signup.php http://pastebin.com/YcvHeHkC