Jump to content

PHP functions question based on bbpress forums


ianizaguirre
Go to solution Solved by ianizaguirre,

Recommended Posts

I have asked this question in 3 different places but I get no answers lol. I hope to find some help here.

 

i want to only display user role for keymaster and moderator users.

I don't want every participant to have their role shown , only the keymaster and moderators are important enough to me to show their role next to their avatar. The following function code i found, and used... It worked but has some issues:

function role_show () {
$displayed_user = bbp_get_reply_author_id() ;
$role = bbp_get_user_role( $displayed_user);
if ( bbp_is_user_keymaster($displayed_user) ||$role == 'bbp_moderator') $args['show_role'] = true ;
else $args['show_role'] = false ;
return $args ;
}
add_filter ('bbp_before_get_reply_author_link_parse_args', 'role_show' )

Code Issues: On the Forums topic post lists, This code also removes the avatar from showing in the same cell section as the “last post by” . And it removes the “last post by” name in this same section. How can I fix this ?

If needed, I could implement this code again and provide a link to the error so you can see.

Thank you for any help.

 

 

 

Side notes:

Someone told me to try

function role_show ($args) {

As my first line , but it did not work. It resulted in the following screenshot :

 

as


post-173662-0-97533400-1416847761_thumb.png

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.