Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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>Fileira</h3>
- <table class="form-table">
- <tr>
- <th><label for="fileira"><?php _e('Fileira'); ?></label></th>
- <td><input type="text" name="fileira" id="fileira" value="<?php echo esc_attr( get_the_author_meta( 'fileira', $user->ID ) ); ?>" class="regular-text" /></td>
- </tr>
- </table>
- <?php }
- add_action( 'personal_options_update', 'my_save_extra_profile_fields' );
- add_action( 'edit_user_profile_update', 'my_save_extra_profile_fields' );
- function my_save_extra_profile_fields( $user_id ) {
- if ( !current_user_can( 'edit_user', $user_id ) )
- return false;
- /* Copy and paste this line for additional fields. Make sure to change 'twitter' to the field ID. */
- update_user_meta( $user_id, 'fileira', $_POST['fileira'] );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement