WordPress.org

Forums

Theme My Login
[resolved] Change Registration Link (9 posts)

  1. caroFan232
    Member
    Posted 2 years ago #

    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/

  2. Jeff Farthing
    Member
    Plugin Author

    Posted 2 years ago #

    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.

  3. caroFan232
    Member
    Posted 2 years ago #

    How do I do that?

  4. DLS Software Studios
    Member
    Posted 2 years ago #

    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');
  5. DLS Software Studios
    Member
    Posted 2 years ago #

    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');
  6. Alain Lankers
    Member
    Posted 2 years ago #

    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.

  7. Sith Lord Goz
    Member
    Posted 2 years ago #

    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...)

  8. Alain Lankers
    Member
    Posted 2 years ago #

    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 );
  9. wzshop
    Member
    Posted 1 year ago #

    Bedankt Alain!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Theme My Login
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags