Advertisement
Guest User

Untitled

a guest
Jan 11th, 2012
596
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. /*
  3. If you would like to edit this file, copy it to your current theme's directory and edit it there.
  4. Theme My Login will always look in your theme's directory first, before using this default template.
  5. */
  6.  
  7. $GLOBALS['current_user'] = $current_user = wp_get_current_user();
  8. $GLOBALS['profileuser'] = $profileuser = get_user_to_edit( $current_user->ID );
  9.  
  10. $user_can_edit = false;
  11. foreach ( array( 'posts', 'pages' ) as $post_cap )
  12.     $user_can_edit |= current_user_can( "edit_$post_cap" );
  13. ?>
  14.  
  15. <div class="login profile" id="theme-my-login<?php $template->the_instance(); ?>">
  16.     <?php $template->the_action_template_message( 'profile' ); ?>
  17.     <?php $template->the_errors(); ?>
  18.     <form id="your-profile" action="" method="post">
  19.         <?php wp_nonce_field( 'update-user_' . $current_user->ID ) ?>
  20.         <p>
  21.             <input type="hidden" name="from" value="profile" />
  22.             <input type="hidden" name="checkuser_id" value="<?php echo $current_user->ID; ?>" />
  23.         </p>
  24.  
  25.         <h3><?php _e( 'Personal Options', 'theme-my-login' ); ?></h3>
  26.  
  27.         <table class="form-table">
  28.         <?php if ( rich_edit_exists() && $user_can_edit ) : // don't bother showing the option if the editor has been removed ?>
  29.         <tr>
  30.             <th scope="row"><?php _e( 'Visual Editor', 'theme-my-login' )?></th>
  31.             <td><label for="rich_editing"><input name="rich_editing" type="checkbox" id="rich_editing" value="false" <?php checked( 'false', $profileuser->rich_editing ); ?> /> <?php _e( 'Disable the visual editor when writing', 'theme-my-login' ); ?></label></td>
  32.         </tr>
  33.         <?php endif; ?>
  34.         <?php if ( count( $GLOBALS['_wp_admin_css_colors'] ) > 1 && has_action( 'admin_color_scheme_picker' ) ) : ?>
  35.         <tr>
  36.             <th scope="row"><?php _e( 'Admin Color Scheme', 'theme-my-login' )?></th>
  37.             <td><?php do_action( 'admin_color_scheme_picker' ); ?></td>
  38.         </tr>
  39.         <?php
  40.         endif; // $_wp_admin_css_colors
  41.         if ( $user_can_edit ) : ?>
  42.         <tr>
  43.             <th scope="row"><?php _e( 'Keyboard Shortcuts', 'theme-my-login' ); ?></th>
  44.             <td><label for="comment_shortcuts"><input type="checkbox" name="comment_shortcuts" id="comment_shortcuts" value="true" <?php if ( !empty( $profileuser->comment_shortcuts ) ) checked( 'true', $profileuser->comment_shortcuts ); ?> /> <?php _e( 'Enable keyboard shortcuts for comment moderation.', 'theme-my-login' ); ?></label> <?php _e( '<a href="http://codex.wordpress.org/Keyboard_Shortcuts" target="_blank">More information</a>', 'theme-my-login' ); ?></td>
  45.         </tr>
  46.         <?php endif; ?>
  47.         <?php if ( function_exists( '_get_admin_bar_pref' ) ) : ?>
  48.         <tr class="show-admin-bar">
  49.             <th scope="row"><?php _e( 'Show Admin Bar', 'theme-my-login' )?></th>
  50.             <td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Show Admin Bar', 'theme-my-login' ); ?></span></legend>
  51.                 <label for="admin_bar_front">
  52.                 <input name="admin_bar_front" type="checkbox" id="admin_bar_front" value="1" <?php checked( _get_admin_bar_pref( 'front', $profileuser->ID ) ); ?> />
  53.                 <?php /* translators: Show admin bar when viewing site */ _e( 'when viewing site', 'theme-my-login' ); ?></label><br />
  54.                 <label for="admin_bar_admin">
  55.                 <input name="admin_bar_admin" type="checkbox" id="admin_bar_admin" value="1" <?php checked( _get_admin_bar_pref( 'admin', $profileuser->ID ) ); ?> />
  56.                 <?php /* translators: Show admin bar in dashboard */ _e( 'in dashboard', 'theme-my-login' ); ?></label>
  57.             </td>
  58.         </tr>
  59.         <?php endif; // function exists ?>
  60.         <?php do_action( 'personal_options', $profileuser ); ?>
  61.         </table>
  62.         <?php do_action( 'profile_personal_options', $profileuser ); ?>
  63.  
  64.         <h3><?php _e( 'Name', 'theme-my-login' ) ?></h3>
  65.  
  66.         <table class="form-table">
  67.         <tr>
  68.             <th><label for="user_login"><?php _e( 'Username', 'theme-my-login' ); ?></label></th>
  69.             <td><input type="text" name="user_login" id="user_login" value="<?php echo esc_attr( $profileuser->user_login ); ?>" disabled="disabled" class="regular-text" /> <span class="description"><?php _e( 'Your username cannot be changed.', 'theme-my-login' ); ?></span></td>
  70.         </tr>
  71.  
  72.         <tr>
  73.             <th><label for="first_name"><?php _e( 'First name', 'theme-my-login' ) ?></label></th>
  74.             <td><input type="text" name="first_name" id="first_name" value="<?php echo esc_attr( $profileuser->first_name ) ?>" class="regular-text" /></td>
  75.         </tr>
  76.  
  77.         <tr>
  78.             <th><label for="last_name"><?php _e( 'Last name', 'theme-my-login' ) ?></label></th>
  79.             <td><input type="text" name="last_name" id="last_name" value="<?php echo esc_attr( $profileuser->last_name ) ?>" class="regular-text" /></td>
  80.         </tr>
  81.  
  82.         <tr>
  83.             <th><label for="nickname"><?php _e( 'Nickname', 'theme-my-login' ); ?> <span class="description"><?php _e( '(required)', 'theme-my-login' ); ?></span></label></th>
  84.             <td><input type="text" name="nickname" id="nickname" value="<?php echo esc_attr( $profileuser->nickname ) ?>" class="regular-text" /></td>
  85.         </tr>
  86.  
  87.         <tr>
  88.             <th><label for="display_name"><?php _e( 'Display name publicly as', 'theme-my-login' ) ?></label></th>
  89.             <td>
  90.                 <select name="display_name" id="display_name">
  91.                 <?php
  92.                     $public_display = array();
  93.                     $public_display['display_nickname']  = $profileuser->nickname;
  94.                     $public_display['display_username']  = $profileuser->user_login;
  95.                     if ( !empty( $profileuser->first_name ) )
  96.                         $public_display['display_firstname'] = $profileuser->first_name;
  97.                     if ( !empty( $profileuser->last_name ) )
  98.                         $public_display['display_lastname'] = $profileuser->last_name;
  99.                     if ( !empty( $profileuser->first_name ) && !empty( $profileuser->last_name ) ) {
  100.                         $public_display['display_firstlast'] = $profileuser->first_name . ' ' . $profileuser->last_name;
  101.                         $public_display['display_lastfirst'] = $profileuser->last_name . ' ' . $profileuser->first_name;
  102.                     }
  103.                     if ( !in_array( $profileuser->display_name, $public_display ) )// Only add this if it isn't duplicated elsewhere
  104.                         $public_display = array( 'display_displayname' => $profileuser->display_name ) + $public_display;
  105.                     $public_display = array_map( 'trim', $public_display );
  106.                     foreach ( $public_display as $id => $item ) {
  107.                         $selected = ( $profileuser->display_name == $item ) ? ' selected="selected"' : '';
  108.                 ?>
  109.                         <option id="<?php echo $id; ?>" value="<?php echo esc_attr( $item ); ?>"<?php echo $selected; ?>><?php echo $item; ?></option>
  110.                 <?php } ?>
  111.                 </select>
  112.             </td>
  113.         </tr>
  114.         </table>
  115.  
  116.         <h3><?php _e( 'Contact Info', 'theme-my-login' ) ?></h3>
  117.  
  118.         <table class="form-table">
  119.         <tr>
  120.             <th><label for="email"><?php _e( 'E-mail', 'theme-my-login' ); ?> <span class="description"><?php _e( '(required)', 'theme-my-login' ); ?></span></label></th>
  121.             <td><input type="text" name="email" id="email" value="<?php echo esc_attr( $profileuser->user_email ) ?>" class="regular-text" /></td>
  122.         </tr>
  123.  
  124.         <tr>
  125.             <th><label for="url"><?php _e( 'Website', 'theme-my-login' ) ?></label></th>
  126.             <td><input type="text" name="url" id="url" value="<?php echo esc_attr( $profileuser->user_url ) ?>" class="regular-text code" /></td>
  127.         </tr>
  128.  
  129.         <?php if ( function_exists( '_wp_get_user_contactmethods' ) ) :
  130.             foreach ( _wp_get_user_contactmethods() as $name => $desc ) {
  131.         ?>
  132.         <tr>
  133.             <th><label for="<?php echo $name; ?>"><?php echo apply_filters( 'user_'.$name.'_label', $desc ); ?></label></th>
  134.             <td><input type="text" name="<?php echo $name; ?>" id="<?php echo $name; ?>" value="<?php echo esc_attr( $profileuser->$name ) ?>" class="regular-text" /></td>
  135.         </tr>
  136.         <?php
  137.             }
  138.             endif;
  139.         ?>
  140.         </table>
  141.  
  142.         <h3><?php _e( 'About Yourself', 'theme-my-login' ); ?></h3>
  143.  
  144.         <table class="form-table">
  145.         <tr>
  146.             <th><label for="description"><?php _e( 'Biographical Info', 'theme-my-login' ); ?></label></th>
  147.             <td><textarea name="description" id="description" rows="5" cols="30"><?php echo esc_html( $profileuser->description ); ?></textarea><br />
  148.             <span class="description"><?php _e( 'Share a little biographical information to fill out your profile. This may be shown publicly.', 'theme-my-login' ); ?></span></td>
  149.         </tr>
  150.  
  151.         <?php
  152.         $show_password_fields = apply_filters( 'show_password_fields', true, $profileuser );
  153.         if ( $show_password_fields ) :
  154.         ?>
  155.         <tr id="password">
  156.             <th><label for="pass1"><?php _e( 'New Password', 'theme-my-login' ); ?></label></th>
  157.             <td><input type="password" name="pass1" id="pass1" size="16" value="" autocomplete="off" /> <span class="description"><?php _e( 'If you would like to change the password type a new one. Otherwise leave this blank.', 'theme-my-login' ); ?></span><br />
  158.                 <input type="password" name="pass2" id="pass2" size="16" value="" autocomplete="off" /> <span class="description"><?php _e( 'Type your new password again.', 'theme-my-login' ); ?></span><br />
  159.                 <div id="pass-strength-result"><?php _e( 'Strength indicator', 'theme-my-login' ); ?></div>
  160.                 <p class="description indicator-hint"><?php _e( 'Hint: The password should be at least seven characters long. To make it stronger, use upper and lower case letters, numbers and symbols like ! " ? $ % ^ &amp; ).', 'theme-my-login' ); ?></p>
  161.             </td>
  162.         </tr>
  163.         <?php endif; ?>
  164.         </table>
  165.  
  166.         <?php
  167.             do_action( 'show_user_profile', $profileuser );
  168.         ?>
  169.  
  170.         <?php if ( count( $profileuser->caps ) > count( $profileuser->roles ) && apply_filters( 'additional_capabilities_display', true, $profileuser ) ) { ?>
  171.         <br class="clear" />
  172.             <table width="99%" style="border: none;" cellspacing="2" cellpadding="3" class="editform">
  173.                 <tr>
  174.                     <th scope="row"><?php _e( 'Additional Capabilities', 'theme-my-login' ) ?></th>
  175.                     <td><?php
  176.                     $output = '';
  177.                     global $wp_roles;
  178.                     foreach ( $profileuser->caps as $cap => $value ) {
  179.                         if ( !$wp_roles->is_role( $cap ) ) {
  180.                             if ( $output != '' )
  181.                                 $output .= ', ';
  182.                             $output .= $value ? $cap : "Denied: {$cap}";
  183.                         }
  184.                     }
  185.                     echo $output;
  186.                     ?></td>
  187.                 </tr>
  188.             </table>
  189.         <?php } ?>
  190.  
  191.         <p class="submit">
  192.             <input type="hidden" name="user_id" id="user_id" value="<?php echo esc_attr( $current_user->ID ); ?>" />
  193.             <input type="submit" class="button-primary" value="<?php esc_attr_e( 'Update Profile', 'theme-my-login' ); ?>" name="submit" />
  194.         </p>
  195.     </form>
  196. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement