Make WordPress Core

Changeset 7317


Ignore:
Timestamp:
03/15/2008 08:27:16 PM (16 years ago)
Author:
westi
Message:

Make the edit link point to the profile for the current user when managing users.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/template.php

    r7307 r7317  
    522522    global $wp_roles;
    523523
     524    $current_user = wp_get_current_user();
     525   
    524526    if ( !( is_object( $user_object) && is_a( $user_object, 'WP_User' ) ) )
    525527        $user_object = new WP_User( (int) $user_object );
     
    534536    $numposts = get_usernumposts( $user_object->ID );
    535537    if ( current_user_can( 'edit_user', $user_object->ID ) ) {
    536         $edit = clean_url( add_query_arg( 'wp_http_referer', urlencode( clean_url( stripslashes( $_SERVER['REQUEST_URI'] ) ) ), "user-edit.php?user_id=$user_object->ID" ) );
     538        if ($current_user->ID == $user_object->ID) {
     539            $edit = 'profile.php';
     540        } else {
     541            $edit = clean_url( add_query_arg( 'wp_http_referer', urlencode( clean_url( stripslashes( $_SERVER['REQUEST_URI'] ) ) ), "user-edit.php?user_id=$user_object->ID" ) );
     542        }
    537543        $edit = "<a href=\"$edit\">$user_object->user_login</a>";
    538544    } else {
Note: See TracChangeset for help on using the changeset viewer.