hi
is it possible to autoaccept user testimonials?
Hi,
Thank you for the question.our team will assist you within 48 hours with a working code to achieve it.
Regards
BrajeshHello,
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
Ravi
Viewing 6 posts - 1 through 6 (of 6 total)
The topic ‘ [Resolved] autoaccept User Testimonials’ is closed to new replies.
This topic is: resolved