Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action( 'show_user_profile', 'show_profile_fields' );
- add_action( 'edit_user_profile', 'show_profile_fields' );
- function show_profile_fields( $user ) { ?>
- <h3><?php _e("More Information") ?></h3>
- <table class="form-table">
- <tr>
- <th><?php _e("Research Interests:"); ?></th>
- <td>
- <textarea name="interests" id="interests" class="regular-text" cols="30" rows="5">
- <?php echo esc_html(get_the_author_meta('interests', $user->ID) ); ?>
- </textarea><br />
- <span class="description"><?php _e("Enter your Research Interests. Separate with commas"); ?></span>
- </td>
- </tr>
- </table>
- <?php }
- add_action( 'personal_options_update', 'save_profile_fields' );
- add_action( 'edit_user_profile_update', 'save_profile_fields' );
- function save_profile_fields( $user_id ) {
- if ( !current_user_can( 'edit_user', $user_id ) )
- return false;
- update_usermeta( $user_id, 'interests', $_POST['interests'] );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement