Support » Plugin: Ultimate Member ā€“ User Profile, User Registration, Login & Membership Plugin » Programmatic to Save UM User Tags into User Meta

  • Resolved Panjianom

    (@pije76)


    My team already buy UM User Tag addon but I don’t have access to contact to UM Support. So I will ask here.

    I want to save User Tag in to user meta. I already created following code to add User Meta:

    function custom_user_profile_fields($user)
    {
    	?>
    	<h3>Informasi Tambahan</h3>
    	<table class="form-table">
    		<tr>
    			<th><label for="field_satker">Satuan Kerja</label></th>
    			<td>
    				<input type="text" class="field_satker" name="field_satker" value="<?php echo esc_attr(get_the_author_meta('field_satker', $user->ID)); ?>" id="field_satker" />
    			</td>
    		</tr>
    	</table>
      <?php
    }
    add_action('show_user_profile', 'custom_user_profile_fields');
    add_action('edit_user_profile', 'custom_user_profile_fields');
    add_action("user_new_form", "custom_user_profile_fields");
    
    function save_satker_user_profile_fields($user_id)
    {
    	if(!current_user_can('manage_options'))
    		return false;
    
    	# save my custom field
    	update_user_meta($user_id, 'field_satker', $_POST['field_satker']);
    }
    add_action('user_register', 'save_satker_user_profile_fields');
    add_action('profile_update', 'save_satker_user_profile_fields');
    

    But it display word: “Array” only, I also change into:
    <input type="text" class="field_satker" name="field_satker" value="<?php echo um_user_tag(); ?>" id="field_satker" />

    And it show nothing.

    Can someone or UM Support help this please?
    Thanks in advanced.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Programmatic to Save UM User Tags into User Meta’ is closed to new replies.