WordPress.org

Make WordPress Core

Ticket #12295: 12295.002.2.diff

File 12295.002.2.diff, 2.7 KB (added by pampfelimetten, 4 years ago)
  • wp-includes/registration.php

     
    323323 */ 
    324324function _wp_get_user_contactmethods() { 
    325325        $user_contactmethods = array( 
     326                'user_email' => __('E-Mail'), 
     327                'user_url' => __('Website'), 
    326328                'aim' => __('AIM'), 
    327329                'yim' => __('Yahoo IM'), 
    328330                'jabber' => __('Jabber / Google Talk') 
    (this hunk was shorter than expected) 
    281289</tr> 
    282290</table> 
    283291 
    284 <h3><?php _e('Contact Info') ?></h3> 
    285292 
    286 <table class="form-table"> 
    287 <tr> 
    288         <th><label for="email"><?php _e('E-mail'); ?> <span class="description"><?php _e('(required)'); ?></span></label></th> 
    289         <td><input type="text" name="email" id="email" value="<?php echo esc_attr($profileuser->user_email) ?>" class="regular-text" /></td> 
    290 </tr> 
     293<?php 
     294$user_contactmethods = _wp_get_user_contactmethods(); 
    291295 
    292 <tr> 
    293         <th><label for="url"><?php _e('Website') ?></label></th> 
    294         <td><input type="text" name="url" id="url" value="<?php echo esc_attr($profileuser->user_url) ?>" class="regular-text code" /></td> 
    295 </tr> 
     296// For backwards compatibility 
     297function user_user_email_label($desc){ 
     298        return  $desc.' <span class="description">'. __('(required)').'</span>'; 
     299} 
     300add_filter('user_user_email_label','user_user_email_label'); 
    296301 
    297 <?php 
    298         foreach (_wp_get_user_contactmethods() as $name => $desc) { 
     302if (!empty($user_contactmethods)) { 
    299303?> 
    300 <tr> 
     304 
     305<div id="profile-contact-info"> 
     306 
     307<h3 id="profile-contact-info-title"><?php _e('Contact Info') ?></h3> 
     308 
     309<table class="form-table"> 
     310 
     311<?php  
     312        foreach ($user_contactmethods as $name => $desc) { 
     313?> 
     314<tr id="profile-contact-info-<?php echo $name; ?>"> 
    301315        <th><label for="<?php echo $name; ?>"><?php echo apply_filters('user_'.$name.'_label', $desc); ?></label></th> 
    302316        <td><input type="text" name="<?php echo $name; ?>" id="<?php echo $name; ?>" value="<?php echo esc_attr($profileuser->$name) ?>" class="regular-text" /></td> 
    303317</tr> 
     
    306321?> 
    307322</table> 
    308323 
    309 <h3><?php IS_PROFILE_PAGE ? _e('About Yourself') : _e('About the user'); ?></h3> 
     324</div> 
     325<?php 
     326} 
     327?> 
    310328 
     329<div id="profile-about-yourself"> 
     330 
     331<h3 id="profile-about-yourself-title"><?php IS_PROFILE_PAGE ? _e('About Yourself') : _e('About the user'); ?></h3> 
     332 
    311333<table class="form-table"> 
    312 <tr> 
     334<tr id="profile-about-yourself-description"> 
    313335        <th><label for="description"><?php _e('Biographical Info'); ?></label></th> 
    314336        <td><textarea name="description" id="description" rows="5" cols="30"><?php echo esc_html($profileuser->description); ?></textarea><br /> 
    315337        <span class="description"><?php _e('Share a little biographical information to fill out your profile. This may be shown publicly.'); ?></span></td>