I have seen some discussion on this, but in the thread they talk about editing the post.php file, but i dont see how that would effect bbPress, and those topics are from around 3 years ago.
You can use the bbp_get_user_profile_url filter. Something like:
add_filter( 'bbp_get_user_profile_url', 'my_custom_author_link' );
function my_custom_author_link( $user_id ){
return get_author_link(false, $user_id);
}
(Not tested, but should help you get on track)
I Tried:
add_filter( 'bbp_get_user_profile_url', 'my_custom_author_link' );
function my_custom_author_link( $user_id ){
return get_author_posts_url(false, $user_id);
}
get_author_link(); appears to have been depreciated.
So using:
add_filter( 'bbp_get_user_profile_url', 'my_custom_author_link' );
function my_custom_author_link( $user_id ){
return get_author_posts_url( $user_id, false );
}
I am able to get to:
http://localhost/wordpress/author/
which is sooo close to what i need.
I need it to return http://localhost/wordpress/author/$user_name
add_filter( 'bbp_get_user_profile_url', 'my_custom_author_link' );
function my_custom_author_link( $user_id ){
$author_info = get_userdata( 1 );
$author_name = $author_info->user_nicename;
return get_author_posts_url( false, $author_name );
}
is working properly.
but when i change the input of
$author_info = get_userdata( 1 );
to
$author_info = get_userdata( $user_id );
I get:
Notice: Trying to get property of non-object in C:\xampp\htdocs\wordpress\wp-content\themes\WoW_Public_Vent_Theme\functions.php on line 274
and it does not work :(;
Soo close.
You’re sending false instead of empty. Try this:
add_filter( 'bbp_get_user_profile_url', 'my_custom_author_link' );
function my_custom_author_link( $user_id ){
return get_author_posts_url( $user_id, '' );
}
That got me to:
http://localhost/wordpress/author/
Still missing the user name at the end of the url
My bad, sorry. Wrong filter.
Do this:
add_filter( 'bbp_pre_get_user_profile_url', 'my_custom_author_link' );
function my_custom_author_link( $user_id ) {
return get_author_posts_url( $user_id, '' );
}
Your the man. Works beautifully.
Surprised this isn’t standard option ive seen alot of questions on it.
If i continue to use bbPress i might make alittle “customization” faq and will def include this.
Thanks again you’ve been supremely helpful.
Bump. I just copied that function into my functions.php file and it’s still linking to the default bbPress forum user page.
My hack job solution was to just modify the plugin itself. Line 356 in template.php contains the permalink structure which you can modify to suit your needs.
// Pretty permalinks
if ( $wp_rewrite->using_permalinks() ) {
$url = $wp_rewrite->root . bbp_get_user_slug() . '/%' . bbp_get_user_rewrite_id() . '%';