Yeah, that specific function’s not at all the right one, it seems to be a well-meaning but naive tip on kai920’s part.
But the basic idea of having a Register link within the bbPress Login Widget is sound, and I’m a bit concerned that it seems to be problematic.
There needs to be a good bundled method of having a link to Register that does NOT show up when a user is already logged in, and the Login Widget is the most logical place to put it. (Obviously it’s trivial to add a Register link to a menu or widget area that would be present all the time).
Two naff, but workable, solutions:
1) Add a field in the bbPress Login Widget for the registration page URL, with “/wp-login.php” set as the default. When the Login Widget is displaying the Log In details, display the registration link (if not blank and if registration is enabled). When the Login Widget is displaying the current user details and log out link, don’t show the registration link.
2) Encourage users to install a pair of simple widgets. I don’t know if decent ones exist, but they’d be called something like Logged In Text and Not Logged In Text, which as their names suggest are like Text widgets but only show their contents if is_user_logged_in() condition is true or false. It’s then simple to add a Register link or whatever to a Not Logged In widget, which could be placed above or below the bbPress Login Widget. If I can’t find an existing pair I’ll knock them out myself soon, although I suspect what I’ll end up doing on most sites is conditionally displaying one entire sidebar or another.
—
The reason both are naff is that it seems pretty clear that there should be a function or method that returns the correct (custom) login page, and the absence of it is causing problems.
Is WP completely unaware of custom registration pages? It seems so. There should be somewhere central that the URLs (or page IDs) of custom Register and Login pages etc are set – and that this should be site based rather than theme based, much like you can set the front page and posts page in WP Reading Settings.
Of course, that’s arguably a WP issue not a bbP issue, but bbP as plugin is at liberty to extend WP in useful ways because that’s what plugins do.
From what you’re saying it sounds like this isn’t part of immediate bbP plans.
I don’t know whether I’m missing a setting, or if it’s something you’ve fixed since b2 but: having registered using a bbPress registration page, the email that people get with their password includes a link to /wp-login.php rather than my /log-in page that uses the bbPress login template. Using that leaves people in an inappropriate interface that they are probably not intended to see, and will confuse (and lose) users.
Am I expected to override this myself with a plugin or in my template? That would mean hard-coding page references. It doesn’t seem right.
I think bbP should just bite the bullet and allow users to specify their login and register pages under Settings. And indeed specify the View Profile page etc. It seems to me that bbP really needs to know where the login page is, and searching for a page with either the bbPress Login template or the Login shortcode (the “magic” method) seems prone to error.
All that said, I don’t want to seem too negative – I am liking bbPress 2.0 a lot and thank you (and everyone involved) for your time on it.