Re: Any idea to integrate wp and bb login forms?
Hi fel64, thanks for the explanation.
I tested and the function works but there are two errors in the code.
First, the id user line displays “21” for every user
global $id; $link = $before . '<a href="' . get_option('siteurl') . '/bbpress/profile.php?id=' . $id . '">' . __('Profile') . '</a>' . $after;
Next, if( current_user_can('administrate')
doesn’t seem to work because it display a link to bbpress profile instead to /wp-admin/
This is the whole function so far;
function wp_registro( $before = '<li>', $after = '</li>' ) {
if ( ! is_user_logged_in() ) {
if ( get_option('users_can_register') )
$link = $before . '<a href="' . get_option('siteurl') . '/wp-login.php?action=register">' . __('Register') . '</a>' . $after;
else
$link = '';
} else { if( current_user_can('administrate') ) {
$link = $before . '<a href="' . get_option('siteurl') . '/wp-admin/">' . __('Site Admin') . '</a>' . $after;}
else {global $id; $link = $before . '<a href="' . get_option('siteurl') . '/bbpress/profile.php?id=' . $id . '">' . __('Profile') . '</a>' . $after;
}
}
echo apply_filters('register', $link);
}
did I made a mistake in the second “else” ?