Replies
Hello,
Please let me know how are you creating BuddyPress Group-specific WordPress roles because before applying to users I am validating the group role with the WordPress roles.
There might be chances that this condition invalidates the group associate role.
Regards
RaviHello,
I am going to test my plugin again and check if it is working fine or not.
I will let you know soon.
Regards
Ravi- Ravi on November 29, 2022 at 10:47 am in reply to: [Resolved] Hook when profile fields are updated from specific group. #47489
Hello Lefteris,
Thank you for the acknowledgment. I am glad that I could help.
Regards
Ravi - Ravi on November 28, 2022 at 6:09 am in reply to: [Resolved] Hook when profile fields are updated from specific group. #47462
Hello Lefteris,
Thank you for posting. BuddyPress does not provide any specific hook for specific field group update. But you can check field group updates in the following way:
add_action( 'xprofile_updated_profile', function ( $user_id, $post_field_ids, $errors, $old_values, $new_values ) { // Check the field group exists. if ( ! bp_is_action_variable( 'group' ) || ! bp_action_variable( 1 ) ) { return; } $group_id = bp_action_variable( 1 ); // Check for your field group ids. $check_for_ids = array( 2 ); if ( in_array( $group_id, $check_for_ids ) ) { // work with your code here. } }, 10, 5 );
Please try it and let me know if it helps or not.
Regards
Ravi - Ravi on November 27, 2022 at 2:56 am in reply to: Hide the BP type box and MPP on Website Activity Page #47458
Hello Daniel,
Please replace the old code with the following one:
add_action( 'bp_before_activity_post_form', function () { if ( bp_is_activity_directory() ) { ob_start(); } } ); add_action( 'bp_after_activity_post_form', function () { if ( bp_is_activity_directory() ) { ob_get_clean(); } }, 99 );
MediaPress does hook its buttons on ‘bp_after_activity_post_form’ which is causing the issue.
Please check now.
Regards
Ravi - Ravi on November 26, 2022 at 7:32 am in reply to: Hide the BP type box and MPP on Website Activity Page #47446
Hello Daniel,
Please try the following code:
add_action( 'bp_before_activity_post_form', function () { if ( bp_is_activity_directory() ) { ob_start(); } } ); add_action( 'bp_after_activity_post_form', function () { if ( bp_is_activity_directory() ) { ob_get_clean(); } } );
Let me know if it helps or not.
Regards
Ravi Hello,
Thank you for the acknowledgment. I am glad that I could help.
Regards
RaviHello Daniel,
1. do I need to add the code to the bp-custom.php file?
Either you can place this code in your ‘bp-custom.php’ file or in your active theme ‘functions.php’ file.
2. Does when applying the code the “Read More” link disappear and the whole post will show?
Yes, Above mention code make this button disappear. Even in large content case, No Read More link will appear.Please check.
Regards
RaviHello,
Please update the plugin ‘BuddyPress User Testimonials’ and use the following code in your ‘bp-custom.php’ file.
add_action( 'bp_testimonials_action_saved_testimonial', function ( $testimonial_id ) { if ( ! class_exists( 'BPTestimonialMapper' ) ) { return; } $testimonial = BPTestimonialMapper::get_comment( $testimonial_id ); $testimonial->comment_approved = 1; if ( ! is_array( $testimonial ) ) { $testimonial = (array) $testimonial; // since we had retrieved object, we need to convert it to array. } wp_update_comment( $testimonial ); }, 9 ); add_filter( 'bp_testimonials_user_notification_testimonial_link', function ( $testimonial_link, $user_id, $action ) { if ( 'new_testimonial' == $action ) { $testimonial_link = trailingslashit( bp_core_get_user_domain( $user_id ) . buddypress()->testimonials->slug ); } return $testimonial_link; }, 10, 3 ); add_filter( 'bp_testimonials_admin_nav', function ( $admin_nav_items ) { $admin_nav_items = array_filter( $admin_nav_items, function ( $admin_nav_item ) { return $admin_nav_item['id'] != 'my-account-testimonials-pending-testimonials'; } ); return $admin_nav_items; } ); add_action( 'bp_testimonials_setup_nav', function () { $parent_slug = buddypress()->testimonials->slug; bp_core_remove_subnav_item( $parent_slug, 'pending-testimonials', 'members' ); } );
Please check and let me know if everything works fine or not.
PS: Refer to this URL if you do not have the ‘bp-custom.php’ file
https://buddydev.com/docs/buddypress-guides/what-is-bp-custom-php/Regards
RaviHello Daniel,
Thank you for posting. The link is broken because BuddyPress shows an excerpted view of activity content means BuddyPress truncates activity content by 358 characters by default. You can disable this using the following code:
add_filter( 'bp_activity_maybe_truncate_entry', '__return_false' );
Please give it a try and let me know.
Regards
Ravi