Make WordPress Core


Ignore:
File:
1 edited

Legend:

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

    r17977 r19528  
    2121
    2222// contextual help - choose Help on the top right of admin panel to preview this.
    23 add_contextual_help($current_screen,
    24     '<p>' . __('This screen lists all the existing users for your site. Each user has one of five defined roles as set by the site admin: Site Administrator, Editor, Author, Contributor, or Subscriber. Users with roles other than Administrator will see fewer options in the dashboard navigation when they are logged in, based on their role.') . '</p>' .
    25     '<p>' . __('You can customize the display of information on this screen as you can on other screens, by using the Screen Options tab and the on-screen filters.') . '</p>' .
    26     '<p>' . __('To add a new user for your site, click the Add New button at the top of the screen or Add New in the Users menu section.') . '</p>' .
     23get_current_screen()->add_help_tab( array(
     24    'id'      => 'overview',
     25    'title'   => __('Overview'),
     26    'content' => '<p>' . __('This screen lists all the existing users for your site. Each user has one of five defined roles as set by the site admin: Site Administrator, Editor, Author, Contributor, or Subscriber. Users with roles other than Administrator will see fewer options in the dashboard navigation when they are logged in, based on their role.') . '</p>' .
     27                 '<p>' . __('To add a new user for your site, click the Add New button at the top of the screen or Add New in the Users menu section.') . '</p>'
     28) ) ;
     29
     30get_current_screen()->add_help_tab( array(
     31    'id'      => 'screen-display',
     32    'title'   => __('Screen Display'),
     33    'content' => '<p>' . __('You can customize the display of this screen in a number of ways:') . '</p>' .
     34                    '<ul>' .
     35                    '<li>' . __('You can hide/display columns based on your needs and decide how many users to list per screen using the Screen Options tab.') . '</li>' .
     36                    '<li>' . __('You can filter the list of users by User Role using the text links in the upper left to show All, Administrator, Editor, Author, Contributor, or Subscriber. The default view is to show all users.  Unused User Roles are not listed.') . '</li>' .
     37                    '<li>' . __('You can view all posts made by a user by clicking on the number under the Posts column.') . '</li>' .
     38                    '</ul>'
     39) );
     40
     41$help = '<p>' . __('Hovering over a row in the users list will display action links that allow you to manage users. You can perform the following actions:') . '</p>' .
     42    '<ul>' .
     43    '<li>' . __('Edit takes you to the editable profile screen for that user. You can also reach that screen by clicking on the username.') . '</li>';
     44
     45if ( is_multisite() )
     46    $help .= '<li>' . __( 'Remove allows you to remove a user from your site. It does not delete their posts. You can also remove multiple users at once by using Bulk Actions.' ) . '</li>';
     47else
     48    $help .= '<li>' . __( 'Delete brings you to the Delete Users screen for confirmation, where you can permanently remove a user from your site and delete their posts. You can also delete multiple users at once by using Bulk Actions.' ) . '</li>';
     49
     50$help .= '</ul>';
     51
     52get_current_screen()->add_help_tab( array(
     53    'id'      => 'actions',
     54    'title'   => __('Actions'),
     55    'content' => $help,
     56) );
     57unset( $help );
     58
     59get_current_screen()->set_help_sidebar(
    2760    '<p><strong>' . __('For more information:') . '</strong></p>' .
    2861    '<p>' . __('<a href="http://codex.wordpress.org/Users_Screen" target="_blank">Documentation on Managing Users</a>') . '</p>' .
     
    68101        if ( ! current_user_can('promote_user', $id) )
    69102            wp_die(__('You can&#8217;t edit that user.'));
    70         // The new role of the current user must also have promote_users caps
    71         if ( $id == $current_user->ID && !$wp_roles->role_objects[$_REQUEST['new_role']]->has_cap('promote_users') ) {
     103        // The new role of the current user must also have the promote_users cap or be a super admin
     104        if ( $id == $current_user->ID && ! is_super_admin() && ! $wp_roles->role_objects[ $_REQUEST['new_role'] ]->has_cap('promote_users') ) {
    72105            $update = 'err_admin_role';
    73106            continue;
     
    217250    foreach ( $userids as $id ) {
    218251        $id = (int) $id;
    219         if ( $id == $current_user->id && !is_super_admin() ) {
     252        if ( $id == $current_user->ID && !is_super_admin() ) {
    220253            $update = 'err_admin_remove';
    221254            continue;
     
    270303        $id = (int) $id;
    271304        $user = new WP_User($id);
    272         if ( $id == $current_user->id && !is_super_admin() ) {
     305        if ( $id == $current_user->ID && !is_super_admin() ) {
    273306            echo "<li>" . sprintf(__('ID #%1s: %2s <strong>The current user will not be removed.</strong>'), $id, $user->user_login) . "</li>\n";
    274307        } elseif ( !current_user_can('remove_user', $id) ) {
Note: See TracChangeset for help on using the changeset viewer.