Info
- 7 posts
- 3 voices
- Started 2 years ago by dbone
- Latest reply from dbone
- This topic is resolved
Filter to Change Login URL
-
- Posted 2 years ago #
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.
-
- Posted 2 years ago #
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!
-
- Posted 2 years ago #
*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.
-
- Posted 2 years ago #
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.
-
- Posted 2 years ago #
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/ -
- Posted 2 years ago #
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.
-
- Posted 2 years ago #
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
-
You must log in to post.