Replies
- Ravi on May 10, 2022 at 10:47 am in reply to: [Resolved] Hiding “whats-new-form” in member activity but NOT in Groups #44896
Hello Yuriix,
Please try the following code:
/** * Check if user can post activity * * @return bool */ function buddydev_user_can_post_activity() { if ( bp_is_group_activity() ) { return true; } // Replace ids by your allowed user ids. $allowed_user_ids = array( 24, 2 ); $can = false; if ( is_super_admin() || in_array( get_current_user_id(), $allowed_user_ids ) ) { $can = true; } return $can; } add_action( 'bp_before_activity_post_form', function() { if ( ! buddydev_user_can_post_activity() ) { ob_start(); } } ); add_action( 'bp_after_activity_post_form', function() { if ( ! buddydev_user_can_post_activity() ) { ob_get_clean(); $css = '#buddypress form#whats-new-form {display: none};'; wp_add_inline_style( 'bp-legacy-css', $css ); } } ); add_action( 'bp_enqueue_scripts', function () { if ( ! buddydev_user_can_post_activity() ) { $css = '#buddypress form#whats-new-form {display: none};'; wp_add_inline_style( 'bp-parent-css', $css ); } }, 15 ); /** * Filter ajax post request */ function buddydev_restrict_post_update() { // Always allow site admin. if ( buddydev_user_can_post_activity() || function_exists( 'bp_nouveau' ) ) { return; } $object = empty( $_POST['object'] ) ? '' : sanitize_key( $_POST['object'] ); if ( ! $object || 'user' == $object || bp_is_user_activity() ) { exit( '-1<div id="message" class="error bp-ajax-message"><p>' . __( 'You are not allowed to post activity.' ) . '</p></div>' ); } } add_action( 'wp_ajax_post_update', 'buddydev_restrict_post_update', 9 );
Please replace the old code with this and give it a try.
Note: It will hide the posting form on the activity directory as well. But users can post group activity within the group.
Regards
Ravi Hello Dianne,
Thank you for the feedback. Tabs are depended on your Theme style with 2.0 BuddyBoss does offer a grey style tab. You can member’s sub-tabs If they are showing different please let me know.
Regards
RaviHello Dianne,
Please upgrade the plugin and give it a try and let me know if subtabs are highlighted with BuddyBoss 2.0 or not.
Regards
Ravi- Ravi on May 9, 2022 at 4:58 am in reply to: BuddyPress Xprofile Custom Field Types : using some WordPress original fields #44880
Hello Bakhta,
Thank you for posting. BuddyPress does support WordPress core fields “Biographical Info” and “First Name, Last Name, Website” under the Text field option. For Social Network fields it seems they are offered by some kind of plugin. If yes, please contact the plugin author to add support for the BuddyPress Profile field.
Regards
Ravi - Ravi on April 27, 2022 at 1:13 pm in reply to: [Resolved] Add confirm email field in the native registration form #44667
Hello Fabien,
Thank you for posting. Please try the following code on gist:
https://gist.github.com/raviousprime/0247df63d7d9214e7d2470128b06c0cd
Please let me know if it helps or not.
Regards
Ravi - Ravi on April 27, 2022 at 12:41 pm in reply to: [Resolved] Buddypress conditional registration #44664
Please note that privacy policy acceptance works with the Nouveau template pack.
Regards
Ravi - Ravi on April 27, 2022 at 12:39 pm in reply to: [Resolved] Buddypress conditional registration #44663
Hello Tosin,
Thank you for posting. BuddyPress does provide default functionality for privacy acceptance. It only checks a published privacy policy page. You can find Privacy Policy page settings under Settings > Privacy page in the dashboard. Please make sure your privacy page is published.
Please give it a try.
Regards
Ravi - Ravi on April 27, 2022 at 12:19 pm in reply to: BuddyPress Xprofile Custom Field Types Country – add Country to list #44662
Hello Chris,
Thank you for your acknowledgement. Please replace ‘ksort’ with ‘asort’ function. It will sort countries by name.
Regards
Ravi Hello Giuseppe,
Thank you for cooperating with us.
Regards
Ravi- Ravi on April 27, 2022 at 12:04 pm in reply to: [Resolved] Adjusting length of text before Read More link #44659
Hello Dale,
Use this code either in your active theme ‘functions.php’ file or ‘bp-custom.php’ file.
For more info: https://buddydev.com/docs/buddypress-guides/what-is-bp-custom-php/
Regards
Ravi