Tagged: activity, groups, hiding, whats-new-form
Hello,
can you advise me how to disable the “whats-new-form” in activities but not in groups? In groups it should still be visible so users can post.
I found this
div#item-body[role=main] form#whats-new-form {
display: none;
}here https://buddypress.org/support/topic/solution-for-hiding-whats-new-form-in-member-activity-but-not-in-groups/ but unfortunately it doesn’t work.
Thank you
Regards
Hi,
Thank you for the question. The css may depend on your theme and template pack.Can you please tell me which theme and template pack are you using?
Thank you
BrajeshHello,
this template https://themeforest.net/item/rehub-directory-multi-vendor-shop-coupon-affiliate-theme/7646339 – https://redeal.lookmetrics.co/
Thank you
Regards
Hi,
Please consult your theme author. It will be a simple css but specific to your theme probably(the selector being used).I wasn’t able to login to their demo, otherwise I could have supplied the css.
Regards
BrajeshHello,
I managed to hide the form for adding Activities (.my-account #whats-new-form{display:none !important}), but I still have one more question.Is it possible to somehow write to the Activity other than through the form? I would like to be the only one to add content there.
Thank you.
Hello Yuriix,
Thank you for the acknowledgement. I am glad that you have resolved the issue on your own.
Regarding your second requirement, Are you looking for a code that will restrict activity posting to only a certain user i.e. No other user can post activity?. If yes, please let me know what sort of activity you want to restrict the activity meaning User activity or group activity.
Regards
RaviHello Yuriix,
Please try the following code in the ‘bp-custom.php’ file.
/** * Filter ajax post request */ function buddydev_restrict_post_update() { // Always allow site admin. if ( is_super_admin() ) { return; } $object = empty( $_POST['object'] ) ? '' : sanitize_key( $_POST['object'] ); // Allowed user ids. $allowed_user_ids = array( 10 ); if ( 'user' == $object && ! in_array( get_current_user_id(), $allowed_user_ids ) ) { wp_send_json_error( array( 'message' => __( 'You are not allowed to post activity.' ) ) ); } } add_action( 'wp_ajax_post_update', 'buddydev_restrict_post_update', 9 );
I am assuming you are using the BP Nouveau template pack.
The topic ‘ [Resolved] Hiding “whats-new-form” in member activity but NOT in Groups’ is closed to new replies.