Make WordPress Core


Ignore:
Timestamp:
04/27/2012 11:13:39 PM (12 years ago)
Author:
nacin
Message:

After adding a user, take them back to users.php with an 'Edit user' link in the message.

This removes the (possibly ineffective) search from the redirect, as well as the URL hash that will get covered up by the toolbar.

fixes #19470. props merty and SergeyBiryukov for initial patches.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/users.php

    r20332 r20631  
    354354        case 'del_many':
    355355            $delete_count = isset($_GET['delete_count']) ? (int) $_GET['delete_count'] : 0;
    356             $messages[] = '<div id="message" class="updated"><p>' . sprintf(_n('%s user deleted', '%s users deleted', $delete_count), $delete_count) . '</p></div>';
     356            $messages[] = '<div id="message" class="updated"><p>' . sprintf( _n( 'User deleted.', '%s users deleted.', $delete_count ), number_format_i18n( $delete_count ) ) . '</p></div>';
    357357            break;
    358358        case 'add':
    359             $messages[] = '<div id="message" class="updated"><p>' . __('New user created.') . '</p></div>';
     359            if ( isset( $_GET['id'] ) && ( $user_id = $_GET['id'] ) && current_user_can( 'edit_user', $user_id ) ) {
     360                $messages[] = '<div id="message" class="updated"><p>' . sprintf( __( 'New user created. <a href="%s">Edit user</a>' ),
     361                    esc_url( add_query_arg( 'wp_http_referer', urlencode( stripslashes( $_SERVER['REQUEST_URI'] ) ),
     362                        self_admin_url( 'user-edit.php?user_id=' . $user_id ) ) ) ) . '</p></div>';
     363            } else {
     364                $messages[] = '<div id="message" class="updated"><p>' . __( 'New user created.' ) . '</p></div>';
     365            }
    360366            break;
    361367        case 'promote':
Note: See TracChangeset for help on using the changeset viewer.