oc1ober Posted April 5, 2021 Share Posted April 5, 2021 Hello ... Please ask how to get the member information (Username) is logged in into an input of the Form, Can you help me with ... Thank you Link to comment Share on other sites More sharing options...
oc1ober Posted May 11, 2021 Author Share Posted May 11, 2021 I use the Code to get the name of the User to login: function show_loggedin_function( $atts ) { global $current_user, $user_login; get_currentuserinfo(); add_filter('widget_text', 'do_shortcode'); if ($user_login) return 'Welcome ' . $current_user->display_name . '!'; else 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now