WordPress User Account Adding Additional Information

WordPress how flexible and extensible code structure that I do not need to say anymore . This flexibility can enter additional fields to the WordPress user accounts . To give an example of a WordPress user profile normally in the e- mail and internet domain present while we can add to it in the phone space . I'm saying you need to do this to perform the following code to add to your theme 's functions.php file , that's all .
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
 
function alan_ekle( $user ) {
?>
   <h3><?php _e('Ek Bilgiler', 'your_textdomain'); ?></h3>
    
   <table class="form-table">
      <tr>
         <th>
            <label for="telefon"><?php _e('Telefon', 'your_textdomain'); ?></label>
         </th>
         <td>
            <input type="text" name="telefon" id="telefon" value="<?php echo esc_attr( get_the_author_meta( 'telefon', $user->ID ) ); ?>" class="regular-text" /><br />
            <span class="description"><?php _e('Lütfen telefon numaranızı giriniz.', 'your_textdomain'); ?></span>
         </td>
      </tr>
   </table>
<?php }
 
function alan_kaydet( $user_id ) {
    
   if ( !current_user_can( 'edit_user', $user_id ) )
      return FALSE;
    
   update_usermeta( $user_id, 'telefon', $_POST['telefon'] );
}
 
add_action( 'show_user_profile', 'alan_ekle' );
add_action( 'edit_user_profile', 'alan_ekle' );
 
add_action( 'personal_options_update', 'alan_kaydet' );
add_action( 'edit_user_profile_update', 'alan_kaydet' );
 
?>
WordPress User Account Adding Additional Information WordPress User Account Adding Additional Information Reviewed by Unknown on 02:12 Rating: 5

Hiç yorum yok