Jump to content

get member information is logged in


Recommended Posts

  • 1 month later...
I use the Code to get the name of the User to login:
function show_loggedin_function( $atts ) {
	global $current_user, $user_login;
	add_filter('widget_text', 'do_shortcode');
	if ($user_login) 
		return 'Welcome ' . $current_user->display_name . '!';
		return '<a href="' . wp_login_url() . ' ">Login</a>';
add_shortcode( 'show_loggedin_as', 'show_loggedin_function' );
- It works well when inserting into widgets or posts in the form [show_loggedin_as]
- But when I insert it into Input in the Form, it doesn't work:
<input name="user" id="u1" type="text" class="field-long" value="[show_loggedin_as]" autocomplete="off"  required="">
Thanks for watching for me with…Thank you.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...