Created
December 28, 2015 02:37
-
-
Save nathaningram/cac48abce0682763deb1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| // Render User First Name Possessive | |
| function ni_UserFirstName() { | |
| global $current_user; | |
| get_currentuserinfo(); | |
| $firstname = $current_user->user_firstname; | |
| if (substr($current_user->user_firstname, -1) == 's') { | |
| return $firstname . "'"; | |
| } | |
| else | |
| return ''.$firstname."'s"; | |
| } | |
| add_shortcode('firstname', 'ni_UserFirstName'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment