WordPress.org

Make WordPress Core

Changeset 10268


Ignore:
Timestamp:
12/30/2008 07:38:44 PM (9 years ago)
Author:
ryan
Message:

Show actions and checkbox only if user is editable by current user. Props jeremyclarke. fixes #8760

File:
1 edited

Legend:

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

    r10246 r10268  
    18061806        $short_url = substr( $short_url, 0, 32 ).'...';
    18071807    $numposts = get_usernumposts( $user_object->ID );
     1808    $checkbox = '';
     1809    // Check if the user for this row is editable
    18081810    if ( current_user_can( 'edit_user', $user_object->ID ) ) {
     1811        // Set up the user editing link
     1812        // TODO: make profile/user-edit determination a seperate function
    18091813        if ($current_user->ID == $user_object->ID) {
    18101814            $edit_link = 'profile.php';
     
    18131817        }
    18141818        $edit = "<strong><a href=\"$edit_link\">$user_object->user_login</a></strong><br />";
     1819       
     1820        // Set up the hover actions for this user
    18151821        $actions = array();
    18161822        $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>';
     
    18261832        }
    18271833        $edit .= '</div>';
     1834       
     1835        // Set up the checkbox (because the user is editable, otherwise its empty)
     1836        $checkbox = "<input type='checkbox' name='users[]' id='user_{$user_object->ID}' class='$role' value='{$user_object->ID}' />";
     1837       
    18281838    } else {
    18291839        $edit = '<strong>' . $user_object->user_login . '</strong>';
     
    18451855        switch ($column_name) {
    18461856            case 'cb':
    1847                 $r .= "<th scope='row' class='check-column'><input type='checkbox' name='users[]' id='user_{$user_object->ID}' class='$role' value='{$user_object->ID}' /></th>";
     1857                $r .= "<th scope='row' class='check-column'>$checkbox</th>";
    18481858                break;
    18491859            case 'username':
Note: See TracChangeset for help on using the changeset viewer.