Created
June 8, 2015 15:42
-
-
Save nathaningram/43ef5b3b1882e0412cbe to your computer and use it in GitHub Desktop.
User First Name Shortcode
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
// First Name of Logged In User Shortcode | |
function ni_firstname() { | |
$user = wp_get_current_user(); | |
$firstname = $user->user_firstname; | |
return $firstname; | |
} | |
add_shortcode('firstname', 'ni_firstname'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment