Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action( 'show_user_profile', 'dealer_auction_extra_user_profile_fields' );
- add_action( 'edit_user_profile', 'dealer_auction_extra_user_profile_fields' );
- add_action( 'personal_options_update', 'dealer_auction_save_extra_user_profile_fields' );
- add_action( 'edit_user_profile_update', 'dealer_auction_save_extra_user_profile_fields' );
- function dealer_auction_save_extra_user_profile_fields( $user_id )
- {
- if ( !current_user_can( 'edit_user', $user_id ) ) { return false; }
- update_user_meta( $user_id, 'dealer_registration_number', $_POST['dealer_registration_number'] );
- }
- function dealer_auction_extra_user_profile_fields( $user )
- { ?>
- <h3>Extra Custom Meta Fields</h3>
- <table class="form-table">
- <tr>
- <th><label for="dealer_registration_number">Dealer Number</label></th>
- <td>
- <input type="text" id="dealer_registration_number" name="dealer_registration_number" size="20" value="<?php echo esc_attr( get_the_author_meta( 'dealer_registration_number', $user->ID )); ?>">
- </td>
- </tr>
- </table>
- <?php }?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement