KeyMaster is the forum role, ::1 is the IP, you’re seeing that because you’re probably posting to localhost.
Just a note on this, you’re only seeing that as the KeyMaster. The rest of the users don’t see that.
If you want to add information in there, hook into the ‘bbp_theme_after_reply_author_details’ action. Like:
`
add_action( ‘bbp_theme_after_reply_author_details’, ‘my_custom_info’ );
function my_custom_info(){
echo “Here it goes!”;
}
`
Thank you for your speedy reply.
This is working great for adding additional information.
But how can i edit what is already displayed in that field by default? IE; totally remove the author role and even author name so i can display custom links there.
you may have already touched on this in my other thread, i will need to re-read it more carefully.
Copy bbpress/templates/default/bbpress/loop-single-reply.php into a bbpress folder in your theme, and in that copy remove from:
` if ( bbp_is_user_keymaster() ) : `
and
` endif; `
Doing the above ^ didnt seem to change anything?
I did however change
`bbp_reply_author_link( array( ‘sep’ => ”, ‘show_role’ => false ) ); `
from true to false. It appears to accomplish what i want it to, but wasn’t sure if it would mess anything else up that relied on it?
Is this the proper way to hide the users forum role?
Thanks.
Seems ok, as long as you change that in your theme’s copy of the file and not in core.
on an unrelated topic;
i have `bbp_get_reply_id()`, which is getting me the id of the topic reply, and im trying to use it to get the id of the author so that i can print any of the authors meta data, role, name, url, etc.
Does bbPress have a method for getting the author id? Sofar using
`
$comment = get_comment( bbp_get_reply_id() );
$comment_author_id = $comment->user_id;
`
returns me my favorite:
Notice: Trying to get property of non-object in C:\xampp\htdocs\wordpress\wp-content\themes\WoW_Public_Vent_Theme\functions.php on line 275
`$id = get_comment(bbp_get_reply_id(), OBJECT)->user_id;
echo $id;`
Doesn’t seem to want to work either :/
Replies are not comments.
`bbp_get_reply_author_id( bbp_get_reply_id() );` will give you what you need.
Let me recommend you to give a good look at the bbPress source code. It’s surprisingly well documented.
Thanks again, ill look through the code some.
`
$user_id = get_userdata( bbp_get_reply_author_id( bbp_get_reply_id() ) ); // Return the get_userdata information
$user = new WP_User( $user_id );
if ( !empty( $user->roles ) && is_array( $user->roles ) ) {
$roles = $user->roles;
echo $roles[0]; //echos only the first role index of 0 of array $roles;
/* Echos all roles
foreach ( $user->roles as $role )
echo $role.””; */
}
`
Accomplished Display the Replies author’s role with the Above ^. Seems like alot of code for such a simple thing but it works :D. Thanks.
get_userdata already returns you the WP_User object. This should do it:
`
$user = get_userdata( bbp_get_reply_author_id( bbp_get_reply_id() ) );
if ( !empty( $user->roles ) && is_array( $user->roles ) ) {
echo $user->roles[0];
}
`