Support » Plugin: Theme My Login » Change Registration Link

  • Resolved caroFan232

    (@carofan232)


    Hello,

    I have Buddypress installed with Theme My Login and I wanted to know how to change the register link to my Buddypress register link. The link is mysite.com/register and it redirects to mysite.com/register-2. I copied the register php from Buddypress and pasted it on the register file of TML to override it. What do I do?

    Thanks

    http://wordpress.org/extend/plugins/theme-my-login/

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Jeff Farthing

    (@jfarthing84)

    Delete the register page that TML has created and apply a callback to the tml_page_link filter to change it’s register link to BP’s register link.

    How do I do that?

    Try putting something like this in your functions.php…

    /**
     * Change register link in Theme My Login
     *
     * @param string $link
     * @param string $action
     * @param string $query
     */
    function dls_change_register_link($link, $action=null, $query=null)
    {
        $parsed_link = parse_url($link);
        $parsed_link['query'] == 'action=register';
    
        if ($parsed_link['query'] == 'action=register') {
            $link = 'YOUR REGISTER LINK HERE';
        }
        return $link;
    }
    add_filter('tml_page_link', 'dls_change_register_link');

    Please disregard the first reference to $parsed_link['query'] == 'action=register'; Actual code should be…

    /**
     * Change register link in Theme My Login
     *
     * @param string $link
     * @param string $action
     * @param string $query
     */
    function dls_change_register_link($link, $action=null, $query=null)
    {
        $parsed_link = parse_url($link);
        if ($parsed_link['query'] == 'action=register') {
            $link = 'YOUR REGISTER LINK HERE';
        }
        return $link;
    }
    add_filter('tml_page_link', 'dls_change_register_link');

    I also tried your code, but TML still looks for the register page it created and not to the register link I put in the code in functions.php.

    In prior versions of TML, there was a settings option to specify the Page IDs used for Log In, Log Out, Password Reset etc.

    These seem to be missing in the latest version – is that intentional? It used to be easy to specify which TML pages did what. Maybe the plugin author can comment?

    (Hooking the URL is fine for people with WP experience, but I imagine it could scare off some first-timers…)

    I used this code succesfully:

    function tml_action_url( $url, $action, $instance ) {
    	switch ( $action ) {
    		case 'register' :
    			$url = '/registreer/';
    			break;
    		case 'lostpassword' :
    			$url = '/wachtwoord/';
    			break;
    	}
    	return $url;
    }
    add_filter( 'tml_action_url', 'tml_action_url', 10, 3 );

    Bedankt Alain!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Change Registration Link’ is closed to new replies.