Forum Replies Created
-
In reply to: Setting User Forum Role By Code
no problem, glad you are fixed !
sorry missed that part
if the code above works then
bbp_reply_author_link( array( ‘sep’ => ‘<br />’, ‘show_role’ => false ) ); $reply_author_id = get_post_field( ‘post_author’, bbp_get_reply_id() ); $user = new WP_User( $reply_author_id ); if ( !empty( $user->roles ) && is_array( $user->roles ) ) { foreach ( $user->roles as $role ) { if ($role=='student') $output = 'client' ; if ($role=='elephant') $output = 'tiger' ; echo “<div class=’role_custom_bhush’>”.ucfirst($output).”</div>”; break; } }
just alter and add as many of these lines as you need
if ($role=='elephant') $output = 'tiger' ;
In reply to: Setting User Forum Role By CodeI’ve just done some testing
this code :
function test_set_user () { $user_id = 1223 ; bbp_set_user_role( $user_id, 'bbp_participant' ); } add_action ('init' , 'test_set_user' ) ;
changes user 1223 on site load, so the code is fine.
I think it is a timing issue – ie when you are doing this. It may well be that even if this fires, a ‘create user’ firing after will overwrite this – eg this may set for pending, but then be overwritten by the final user creation.
Of course if it is always going to be participant, then bbpress allocates the user to the default role (as set in settings>forums>default role) if no bbpress role is set on first login, so you could just set up the user, and bbpress will take care of giving them a role when they first log in!
In reply to: Admin Login redirects me to site front-endIn reply to: Migrate wp posts to bbPress forumsyou’d probably need to hire someone to do this
In reply to: Setting User Forum Role By CodeI’d suggest that the issue is that the bp_core_signup_user is not returning a valid $user_id
you could prove that by writing a console output to see what is being supplied, eg
// create the user from the bp_core method, to make sure it passes the activation mode first $user_id = bp_core_signup_user( $post->username, $post->password, $post->email, [] ); echo "<script>console.log('" . $user_id . "');</script>" ; bbp_set_user_role( $user_id, "bbp_participant" );
and then looking in the console in your browser tools
maybe better to ask the question in ten buddypress support as to why the correct user_id is not being returned
In reply to: Custom fields and controls in editorit is doable but would require bespoke coding
if you want to hire someone, then Milan or I might be able to help
you can change names using my plugin
once activated go to
dashboard>settings>bbp style pack>Forum Roles
In reply to: insert/ edit image (links) not workingdoes it change if you deactivate the bbp style pack plugin ?
In reply to: How to Hire a bbPress Expert for Quick Consults?I do bespoke work on bbpress, but Milan is also excellent, and as he got in first start with him.
In reply to: How to delete replies from frontendnone that I know of for multiple replies
In reply to: How to remove wordpress barlots of plugin to remove admin bar
https://wordpress.org/plugins/tags/admin-bar/
and to design forum
In reply to: Change the Search ButtonIn reply to: Not send email notifications at all userscould be loads of reasons, including throttling by your host provider, intermediate emails systems etc.
In reply to: bbPress ModerationI would first of all try the more up to date version of this
and then reach out to the support forum of that pluigin
In reply to: how to set minimum reply length.great – glad you are fixed
In reply to: Login pagegreat – glad you are fixed
In reply to: how to set minimum reply length.add this to your functions file
function rew_min_length ($reply_content) { if (strlen($reply_content)<61) { bbp_add_error( 'bbp_reply_content', __( '<strong>ERROR</strong>: Your reply must be at least 60 characters.', 'bbpress' ) ); } return $reply_content ; } add_filter( 'bbp_new_reply_pre_content', 'rew_min_length' );
In reply to: how to create dynamic reply-boxsorry, that’s how it works in bbpress.
But if you do get to someone who has coded, please post the result back here to help others.
my style pack plugin has a button you can add to the pages to make it clearer
once activated go to
dashboard>settings>bbp style pack>Buttons
In reply to: BB press profile pageother people’s public profile is via the author link on topics/replies – ie click any users name link on their post
In reply to: BB press profile pagelink to one’s bbp profile in menu
once activated go to
dashboard>settings>bbp style pack>login
In reply to: possible to pre-fill a post ?anything is possible, but this is a chunk of code that you are hoping someone will do for free 🙂
In reply to: Remove ‘bbPress Forums’ from Menuno problem
In reply to: Remove ‘bbPress Forums’ from MenuI’m pretty sure it’s a setting in your theme which you should be able to blank, but this will fix it in any case
put the following in your theme’s custom css
.fusion-menu-description { display : none ; }
ok thanks for the update