Forums

Join
bbPress Support ForumsPluginsFilter to Change Login URL

Info

Tags

Filter to Change Login URL

  1. Trying to find the filter to change the URL for "You must log in to post." to an alternate URL since I am using a custom WP user management plugin and want all users to use custom WP login page.

    Tried using the user_link and user_profile_link filters found at http://www.mittineague.com/dev/bbpafrl1_0.php but neither worked.

  2. I did this on a bbPress install recently... but rather than doing anything tricky programmatically, I just changed the links in the theme.

    It worked great!

  3. *ponder* dbone, if they use the must login to post link, they stay on the same page as they already are, so it shouldn't be an issue, right?

    I mean, all you really have to do is redirect registration to your profile manager tool.

  4. Which file did you edit? I was not able to find it in the default theme.

    I did find the code that creates the link in /bb-includes/function-bbtemplate.php, post_form(), line 311 for version 1.0.1.

  5. I think it was the login.php file.

    Definitely don't edit any pages in bb-includes... create a /my-templates/ folder as described here!
    http://bbpress.org/documentation/themes/

  6. I should have been more clear on where I am trying to update the link. After clicking on a forum from the front page the following is displayed at the bottom:

    New Topic in this Forum
    You must log in to post.

    Looked in login.php and couldn't find the line in question (I do have a template in my-templates).

    I can try using the action bb_init but I don't know how to pull in the content to apply a regex similar to WPs the_content filter.

  7. Not sure if this is the best method but I don't have more time to research and here is what I came up with:

    1. Create a new file; /my-plugins/bb-template.php
    2. Code:

    add_filter('bb_template', '_bb_template');
    
    function _bb_template($template)
    {
    	if (preg_match('/login.php/i', $template))
    	{
    		header('Location: /myurl/');
    		exit();
    	}
    
    	return $template;
    }

    3. Activate in bb-admin

  8. You must log in to post.