Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * We are ironically undoing theme my login's theming of the login
- * (and keeping registration approvals)
- * (and keeping themed profiles)
- * @param string $link what tml wants
- * @param string $action what the user wants to do
- * @param array $query where the user is going
- * @return string $link what the client wants
- */
- function remove_tml_login_pages( $link, $action, $query ) {
- if ( $action !== 'logout' && class_exists( 'Theme_My_Login') ) {
- // remove redundancy on admin_url
- remove_filter('tml_page_link', array( $this, 'remove_tml_login_pages'), 10, 3 );
- if ( ! isset( $query['redirect_to'] ) )
- $query['redirect_to'] = urlencode( admin_url('profile.php') );
- if ( ! isset( $query['action'] ) )
- $query['action'] = $action;
- $theme_my_login = Theme_My_Login::get_object();
- // remove redundancies
- remove_filter('site_url', array( $theme_my_login, 'site_url' ), 10, 3 );
- $link = add_query_arg( $query, site_url('wp-login.php') );
- // put 'em back
- add_filter('site_url', array( $theme_my_login, 'site_url'), 10, 3 );
- add_filter('tml_page_link', array( $this, 'remove_tml_login_pages'), 10, 3 );
- }
- return $link;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement