Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2012
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. add_action( 'show_user_profile', 'my_show_extra_profile_fields' );
  2. add_action( 'edit_user_profile', 'my_show_extra_profile_fields' );
  3.  
  4. function my_show_extra_profile_fields( $user ) { ?>
  5.  
  6. <h3>Fileira</h3>
  7.  
  8. <table class="form-table">
  9.  
  10. <tr>
  11. <th><label for="fileira"><?php _e('Fileira'); ?></label></th>
  12.  
  13. <td><input type="text" name="fileira" id="fileira" value="<?php echo esc_attr( get_the_author_meta( 'fileira', $user->ID ) ); ?>" class="regular-text" /></td>
  14. </tr>
  15.  
  16. </table>
  17. <?php }
  18. add_action( 'personal_options_update', 'my_save_extra_profile_fields' );
  19. add_action( 'edit_user_profile_update', 'my_save_extra_profile_fields' );
  20.  
  21. function my_save_extra_profile_fields( $user_id ) {
  22.  
  23. if ( !current_user_can( 'edit_user', $user_id ) )
  24. return false;
  25.  
  26. /* Copy and paste this line for additional fields. Make sure to change 'twitter' to the field ID. */
  27. update_user_meta( $user_id, 'fileira', $_POST['fileira'] );
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement