Created
September 1, 2016 12:55
-
-
Save sjaved87/ac5df26fb27f904cbbc12e5efd76027a to your computer and use it in GitHub Desktop.
This shortcode will display display name of the logged in user. This is the shortcode [welcome_message].
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 | |
function sjaved_welcome_message_cb(){ | |
$current_user = wp_get_current_user(); | |
echo 'Hello ' . $current_user->display_name ; | |
} | |
add_shortocde('welcome_message', 'sjaved_welcome_message_cb', 10); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment