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 the user is authorized and 2 - your profile is how to make the user transfer to your profile after authorization, but not my account? I tried to override the redirect function, but to no avail ..

 function tml_redirect_url( $url, $action ) { if ( 'register' == $action ) $url = 'АДРЕС'; return $url; } add_filter( 'tml_redirect_url', 'tml_redirect_url', 10, 2 ); 

here are the functions responsible for redirecting ajax.php

 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; } 

class-theme-my-login-template.php

 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 ); } 

    1 answer 1

    I made it much easier - I posted a profile shortcode on the personal account page [theme-my-login default_action=profile profile_template=tml-profile-form.php]