/** * Prepare user row actions * * @param WP_User $user * * @return array * * @access protected */ protected function prepareRowActions(WP_User $user) { $max = AAM_Core_API::maxLevel(wp_get_current_user()->allcaps); if ($max < AAM_Core_API::maxLevel($user->allcaps)) { $actions = array('no-manage', 'no-lock', 'no-edit'); } else { $actions = array('manage'); $prefix = $user->ID == get_current_user_id() ? 'no-' : ''; $actions[] = $prefix . ($user->user_status ? 'unlock' : 'lock'); $actions[] = 'edit'; } return $actions; }
/** * Prepare user row actions * * @param WP_User $user * * @return array * * @access protected */ protected function prepareRowActions(WP_User $user) { $max = AAM_Core_API::maxLevel(wp_get_current_user()->allcaps); if ($max < AAM_Core_API::maxLevel($user->allcaps)) { $actions = array('no-manage', 'no-lock', 'no-edit'); } else { $actions = array('manage'); $prefix = $user->ID == get_current_user_id() ? 'no-' : ''; $actions[] = $prefix . ($user->user_status ? 'unlock' : 'lock'); $actions[] = 'edit'; } if (class_exists('user_switching')) { $url = user_switching::maybe_switch_url($user); if (!in_array('edit', $actions) || empty($url)) { $actions[] = 'no-switch'; } else { $actions[] = 'switch|' . $url; } } return $actions; }