How can I get username into shortcode

I want to get username in a shortcode according to url (profile page url)

For example:
profile url : domain.com/johndoe (domain.com/username)

My code is;

<?php echo do_shortcode('[adress="username"]'); ?>

“username” should be changed automatically according to url.

I want to get johndoe,janedoe etc. istead of “username” as “johndoe” in shortcode

Thanks


Source: shortcode

Leave a Reply