Ticket #12295: 12295.002.2.diff

File 12295.002.2.diff, 2.7 KB (added by pampfelimetten, 3 years ago)
Line 
1Index: wp-includes/registration.php
2===================================================================
3--- wp-includes/registration.php        (Revision 13628)
4+++ wp-includes/registration.php        (Arbeitskopie)
5@@ -323,6 +323,8 @@
6  */
7 function _wp_get_user_contactmethods() {
8        $user_contactmethods = array(
9+               'user_email' => __('E-Mail'),
10+               'user_url' => __('Website'),
11                'aim' => __('AIM'),
12                'yim' => __('Yahoo IM'),
13                'jabber' => __('Jabber / Google Talk')
14@@ -281,23 +289,30 @@
15 </tr>
16 </table>
17 
18-<h3><?php _e('Contact Info') ?></h3>
19 
20-<table class="form-table">
21-<tr>
22-       <th><label for="email"><?php _e('E-mail'); ?> <span class="description"><?php _e('(required)'); ?></span></label></th>
23-       <td><input type="text" name="email" id="email" value="<?php echo esc_attr($profileuser->user_email) ?>" class="regular-text" /></td>
24-</tr>
25+<?php
26+$user_contactmethods = _wp_get_user_contactmethods();
27 
28-<tr>
29-       <th><label for="url"><?php _e('Website') ?></label></th>
30-       <td><input type="text" name="url" id="url" value="<?php echo esc_attr($profileuser->user_url) ?>" class="regular-text code" /></td>
31-</tr>
32+// For backwards compatibility
33+function user_user_email_label($desc){
34+       return  $desc.' <span class="description">'. __('(required)').'</span>';
35+}
36+add_filter('user_user_email_label','user_user_email_label');
37 
38-<?php
39-       foreach (_wp_get_user_contactmethods() as $name => $desc) {
40+if (!empty($user_contactmethods)) {
41 ?>
42-<tr>
43+
44+<div id="profile-contact-info">
45+
46+<h3 id="profile-contact-info-title"><?php _e('Contact Info') ?></h3>
47+
48+<table class="form-table">
49+
50+<?php
51+       foreach ($user_contactmethods as $name => $desc) {
52+?>
53+<tr id="profile-contact-info-<?php echo $name; ?>">
54        <th><label for="<?php echo $name; ?>"><?php echo apply_filters('user_'.$name.'_label', $desc); ?></label></th>
55        <td><input type="text" name="<?php echo $name; ?>" id="<?php echo $name; ?>" value="<?php echo esc_attr($profileuser->$name) ?>" class="regular-text" /></td>
56 </tr>
57@@ -306,10 +321,17 @@
58 ?>
59 </table>
60 
61-<h3><?php IS_PROFILE_PAGE ? _e('About Yourself') : _e('About the user'); ?></h3>
62+</div>
63+<?php
64+}
65+?>
66 
67+<div id="profile-about-yourself">
68+
69+<h3 id="profile-about-yourself-title"><?php IS_PROFILE_PAGE ? _e('About Yourself') : _e('About the user'); ?></h3>
70+
71 <table class="form-table">
72-<tr>
73+<tr id="profile-about-yourself-description">
74        <th><label for="description"><?php _e('Biographical Info'); ?></label></th>
75        <td><textarea name="description" id="description" rows="5" cols="30"><?php echo esc_html($profileuser->description); ?></textarea><br />
76        <span class="description"><?php _e('Share a little biographical information to fill out your profile. This may be shown publicly.'); ?></span></td>