Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function custom_shortcode_func() {
- ob_start();
- $username = wp_get_current_user();
- echo '<b>' . $username->display_name . '</b>';
- $output = ob_get_clean();
- return $output;
- }
- add_shortcode('username', 'custom_shortcode_func');
- [username]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement