Tagged: profile-type
Previously ya’ll helped me restrict the comment activity of specific profile types such as student…but I am wondering if either of the following customizations is possible?
1) make the default type the restricted profile type (1st choice solution)
2) OR Limit profile type drop down options to just two profile types, excluding the default type
Thank you
Hi,
Thank you for the question.Are you using member type profile field? If yes, you can set the default field type option as well as disable the “–”
Please visit Dashboard->Users->Profile Fields and edit the member type field settings.
Regards
BrajeshNo, I think I may not be clear. Sorry. Below is the bp-custom.php script ya’ll helped me to create that restricts “none” profile type’s reply comments. And my question is how to I block the “Default” option rather than the “none” option. I tried leaving it blank like (‘ ‘) and the website crashed, so…how do I do that?
<?php
function buddydev_user_can_reply_on_comment( $can ) {
// Replace ‘student’ with your member type.
$is_restricted = bp_has_member_type( get_current_user_id(), ‘none’);if ( $is_restricted ) {
$can = false;
}return $can;
Any suggestions? Also I don’t see the Dashboard >Users>Profile Field area in my wordpress dashboard. Please let me know what I should replace the ‘none’ with in order to make the default the “‘none'”
Yes, in this screen you will see 3 profile type options: ‘—-‘, ‘none’, and ‘practicing’. And I’d like to either remove the ‘—-‘ option from the dropdown or in my custom.php script make this option the one that cannot send replies.
https://ibb.co/3pjM4ZyNOTE: the ‘—-‘ seems to be a default or “null” profile type which I can’t seem to remove. Ideally I would just remove it.
Hello Brian,
Thank you for sharing the screenshots. Please replace the old code which is shared here:
with
/** * Restrict member type for replying * * @param bool $can Bool. * * @return bool */ function buddydev_user_can_reply_on_comment( $can ) { // Replace 'student' with your member type. $user_member_types = bp_get_member_type( get_current_user_id(), false ); $user_member_types = empty( $user_member_types ) ? array() : $user_member_types; if ( ! $user_member_types || in_array( 'student', $user_member_types ) ) { $can = false; } return $can; } add_filter( 'bp_activity_can_comment_reply', 'buddydev_user_can_reply_on_comment' );
Please check
Regards
Ravi- This reply was modified 2 years, 9 months ago by Ravi.
It works! One related question…it seems that the custom.php file causes my media popup for buddypress polls to appear behind the modal for front-end post submission…do you know how I can make the media upload modal popup over the front-end submission instead of behind?
You must be logged in to reply to this topic.