Community Documentation

RealName: theme_username

Last updated March 13, 2009. Created by NancyDru on March 13, 2009.
Log in to edit this page.

The RealName module intercepts the theme('username',...) and allows extensions in keeping with core issue #192056: User's raw login name should not be output directly.

Format a username with options.

  • Parameters
    $object
    The user object to format, usually returned from user_load(). Note that node and comment objects also contain the necessary information.
    $options
    An associative array of theme options.
    • 'plain' => whether or not to make the name a link (default: FALSE)
    • 'picture' => whether or not to include the user's picture (default: FALSE) Note: will not be done if 'plain' = TRUE.
    • 'homepage' => link may be to the user's homepage (default: TRUE)
    • 'levels' => include user level marking (default: TRUE)
    • 'max_length' => maximum name length to show (default: from settings page)
    • 'not_ver' => whether to show "not verified" (default: from settings page)
  • Return

    A string containing an HTML link to the user's page if the passed object suggests that this is a site user. Otherwise, only the username is returned.

About this page

Drupal version
Drupal 6.x
Audience
Developers and coders, Themers

Administration Guide

Drupal’s online documentation is © 2000-2012 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License.