Answer the question
In order to leave comments, you need to log in
How to set up a redirect to your profile in Theme My Login plugin?
Greetings. There is a wordpress site on which the Theme My Login profile plugin is installed in which 2 pages are created:
1 - my account, where it is immediately transferred after user authorization and
2 - your profile
how to make it so that after authorization it transfers the user to your profile, and not my account?
I tried to play with links - so far I have not been able to come up with anything effective ..
here are the functions responsible for the
ajax.php redirect
public function tml_redirect_url( $url, $action ) {
if ( Theme_My_Login::is_tml_page() && in_array( $action, self::default_actions() ) && isset( $_GET['ajax'] ) ) {
switch ( $action ) {
case 'lostpassword' :
case 'retrievepassword' :
case 'register' :
$url = add_query_arg( 'ajax', 1, $url );
break;
case 'login' :
$url = Theme_My_Login::get_page_link( 'login', 'ajax=1' );
break;
}
}
return $url;
}
public function the_redirect_url( $action = '' ) {
echo esc_attr( $this->get_redirect_url( $action ) );
}
public function get_redirect_url( $action = '' ) {
$theme_my_login = Theme_My_Login::get_object();
if ( empty( $action ) )
$action = $this->get_option( 'default_action' );
$redirect_to = isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '';
switch ( $action ) {
case 'lostpassword' :
case 'retrievepassword' :
$url = apply_filters( 'lostpassword_redirect', ! empty( $redirect_to ) ? $redirect_to : Theme_My_Login::get_page_link( 'login', 'checkemail=confirm' ) );
break;
case 'register' :
$url = apply_filters( 'registration_redirect', ! empty( $redirect_to ) ? $redirect_to : Theme_My_Login::get_page_link( 'login', 'checkemail=registered' ) );
break;
case 'login' :
default :
$url = apply_filters( 'login_redirect', ! empty( $redirect_to ) ? $redirect_to : admin_url(), $redirect_to, null );
}
return apply_filters( 'tml_redirect_url', $url, $action );
}
Answer the question
In order to leave comments, you need to log in
Made it much easier - on the personal account page I placed the profile shortcode
[theme-my-login default_action=profile profile_template=tml-profile-form.php]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question