Make WordPress Core


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/user-edit.php

    r17382 r17975  
    4545    '<p>' . __('Remember to click the Update Profile button when you are finished.') . '</p>' .
    4646    '<p><strong>' . __('For more information:') . '</strong></p>' .
    47     '<p>' . __('<a href="http://codex.wordpress.org/Users_Your_Profile_SubPanel" target="_blank">Documentation on User Profiles</a>') . '</p>' .
     47    '<p>' . __('<a href="http://codex.wordpress.org/Users_Your_Profile_Screen" target="_blank">Documentation on User Profiles</a>') . '</p>' .
    4848    '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
    4949);
     
    5252$wp_http_referer = remove_query_arg(array('update', 'delete_count'), stripslashes($wp_http_referer));
    5353
    54 $all_post_caps = array('posts', 'pages');
    55 $user_can_edit = false;
    56 foreach ( $all_post_caps as $post_cap )
    57     $user_can_edit |= current_user_can("edit_$post_cap");
     54$user_can_edit = current_user_can( 'edit_posts' ) || current_user_can( 'edit_pages' );
    5855
    5956/**
     
    162159    <p><strong><?php _e('User updated.') ?></strong></p>
    163160    <?php if ( $wp_http_referer && !IS_PROFILE_PAGE ) : ?>
    164     <p><a href="<?php echo esc_url( $wp_http_referer ); ?>"><?php _e('&larr; Back to Authors and Users'); ?></a></p>
     161    <p><a href="<?php echo esc_url( $wp_http_referer ); ?>"><?php _e('&larr; Back to Users'); ?></a></p>
    165162    <?php endif; ?>
    166163</div>
     
    172169<div class="wrap" id="profile-page">
    173170<?php screen_icon(); ?>
    174 <h2><?php echo esc_html( $title ); ?></h2>
     171<h2>
     172<?php
     173echo esc_html( $title );
     174if ( ! IS_PROFILE_PAGE ) {
     175    if ( current_user_can( 'create_users' ) ) { ?>
     176        <a href="user-new.php" class="add-new-h2"><?php echo esc_html_x( 'Add New', 'user' ); ?></a>
     177    <?php } elseif ( is_multisite() && current_user_can( 'promote_users' ) ) { ?>
     178        <a href="user-new.php" class="add-new-h2"><?php echo esc_html_x( 'Add Existing', 'user' ); ?></a>
     179    <?php }
     180} ?>
     181</h2>
    175182
    176183<form id="your-profile" action="<?php echo esc_url( self_admin_url( IS_PROFILE_PAGE ? 'profile.php' : 'user-edit.php' ) ); ?>" method="post"<?php do_action('user_edit_form_tag'); ?>>
     
    214221<label for="admin_bar_admin">
    215222<input name="admin_bar_admin" type="checkbox" id="admin_bar_admin" value="1" <?php checked( _get_admin_bar_pref( 'admin', $profileuser->ID ) ); ?> />
    216 <?php /* translators: Show admin bar in dashboard */ _e( 'in dashboard' ); ?></label>
     223<?php /* translators: Show admin bar in dashboard */ _e( 'in dashboard' ); ?></label></fieldset>
    217224</td>
    218225</tr>
     
    285292        <?php
    286293            $public_display = array();
     294            $public_display['display_nickname']  = $profileuser->nickname;
    287295            $public_display['display_username']  = $profileuser->user_login;
    288             $public_display['display_nickname']  = $profileuser->nickname;
     296
    289297            if ( !empty($profileuser->first_name) )
    290298                $public_display['display_firstname'] = $profileuser->first_name;
     299
    291300            if ( !empty($profileuser->last_name) )
    292301                $public_display['display_lastname'] = $profileuser->last_name;
     302
    293303            if ( !empty($profileuser->first_name) && !empty($profileuser->last_name) ) {
    294304                $public_display['display_firstlast'] = $profileuser->first_name . ' ' . $profileuser->last_name;
    295305                $public_display['display_lastfirst'] = $profileuser->last_name . ' ' . $profileuser->first_name;
    296306            }
     307
    297308            if ( !in_array( $profileuser->display_name, $public_display ) ) // Only add this if it isn't duplicated elsewhere
    298309                $public_display = array( 'display_displayname' => $profileuser->display_name ) + $public_display;
     310
    299311            $public_display = array_map( 'trim', $public_display );
    300312            $public_display = array_unique( $public_display );
     313
    301314            foreach ( $public_display as $id => $item ) {
    302315        ?>
    303             <option id="<?php echo $id; ?>" value="<?php echo esc_attr($item); ?>"<?php selected( $profileuser->display_name, $item ); ?>><?php echo $item; ?></option>
     316            <option id="<?php echo $id; ?>"<?php selected( $profileuser->display_name, $item ); ?>><?php echo $item; ?></option>
    304317        <?php
    305318            }
Note: See TracChangeset for help on using the changeset viewer.