Shortcode Query
-
Hey,
I’m currently using a shortcode I found to display the username of the current logged in user. Using the currentuserinfo section in the codex, I’ve attempted multiple variations to have it display the ‘firstname’ instead. I’m a total novice with php – is this even possible with the current code I have (below)?
add_shortcode( 'current-username' , 'ss_get_current_username' ); function ss_get_current_username(){ $user = wp_get_current_user(); return $user->display_name; }
Any advice would be massively appreciated!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Shortcode Query’ is closed to new replies.