Last active
March 26, 2017 01:47
-
-
Save massiws/de1b2b0bf0b6994468ee6ead9bf5eb9a to your computer and use it in GitHub Desktop.
Drupal 7: display username in user-menu block title
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Implements MY_THEME_preprocess_block(). | |
*/ | |
function MY_THEME_preprocess_block(&$variables) { | |
global $user; | |
$block =& $variables['block']; | |
if ($block->module == 'system' && $block->delta == 'user-menu' && user_is_logged_in()) { | |
$block->subject = check_plain($user->name); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment