Last active
September 30, 2022 05:33
-
-
Save hkitago/4f1d748d8be8db64055a776bb8d4081b to your computer and use it in GitHub Desktop.
Get user description for WordPress Shortcodes
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
// use [user_description] in a block, get $user_ID echo '<script>console.log("'.$user_ID.'")</script>'; in function.php before. | |
function get_user_description() { | |
$user_ID = get_current_user_id(); | |
return get_user_meta({$user_ID}, 'description', true); | |
} | |
add_shortcode('user_description', 'get_user_description'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment