Redirecting the bp_login_bar – almost got it!
-
Hi all, need some help,
I have the following in the bp_core_templatetags.php file:
<form name=”login-form” id=”login-form” action=”<?php echo $bp->root_domain . ‘/wp-login.php’ ?>” method=”post”>
<input type=”text” name=”log” id=”user_login” value=”<?php _e( ‘Username’, ‘buddypress’ ) ?>” onfocus=”if (this.value == ‘<?php _e( ‘Username’, ‘buddypress’ ) ?>’) {this.value = ”;}” onblur=”if (this.value == ”) {this.value = ‘<?php _e( ‘Username’, ‘buddypress’ ) ?>’;}” />
<input type=”password” name=”pwd” id=”user_pass” class=”input” value=”" />
<input type=”checkbox” name=”rememberme” id=”rememberme” value=”forever” title=”<?php _e( ‘Remember Me’, ‘buddypress’ ) ?>” />
<input type=”submit” name=”wp-submit” id=”wp-submit” value=”<?php _e( ‘Log In’, ‘buddypress’ ) ?>” />
<input type=”button” name=”signup-submit” id=”signup-submit” value=”<?php _e( ‘Join up’, ‘buddypress’ ) ?>” onclick=”location.href=’<?php echo bp_signup_page() ?>’” />
<input type=”hidden” name=”redirect_to” value=”/members/<?php bp_core_get_username() ?>/profile” />
<input type=”hidden” name=”testcookie” value=”1″ />
This is the code for the form in the sign in bar on the home page. I want to use this to redirect the user to their profile page.
All I need is a small piece of code that takes the username inputted into the ‘username’ box and places into ‘bp_core_get_username()’ above. The reason I know this must work is, if you replace that with the actual username and login with that username, it goes directly to the user profile page.
Can someone please suggest the code needed to input the username?
Thanks very much
DevWeb
You must be logged in to reply to this topic.