Skip to:
Content
Pages
Categories
Search
Top
Bottom

short tags > display user’s username is posts/pages

  • Hi, I’ve created a short tag that I have added to buddypress-home/functions.php

    The function should enable me to add the shortcode [uname] in posts and pages and display the current user’s username. Unfortunately it doesn’t bloody work! Can anyone point me in the right direction?

    function displayusername() {
    global $current_user;
    return($current_user->user_login);
    }
    add_shortcode('uname', 'displayusername');

  • The topic ‘short tags > display user’s username is posts/pages’ is closed to new replies.
Skip to toolbar