function blog_user_view

Implements hook_user_view().

File

modules/blog/blog.module, line 24

Code

function blog_user_view($account) {
    if (user_access('create blog content', $account)) {
        $account->content['summary']['blog'] = array(
            '#type' => 'user_profile_item',
            '#title' => t('Blog'),
            // l() escapes the attributes, so we should not escape !username here.
'#markup' => l(t('View recent blog entries'), "blog/{$account->uid}", array(
                'attributes' => array(
                    'title' => t("Read !username's latest blog entries.", array(
                        '!username' => format_username($account),
                    )),
                ),
            )),
            '#attributes' => array(
                'class' => array(
                    'blog',
                ),
            ),
        );
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.