bp_activity_comment_privacy_update( BP_Activity_Activity $comment, string $privacy )

Recursive function to update privacy of comment with nested level.

Description

Parameters

$comment

(Required) Activity comment object

$privacy

(Required) Parent Activity privacy

Source

File: bp-activity/bp-activity-filters.php

function bp_activity_comment_privacy_update( $comment, $privacy ) {
	$comment_activity = new BP_Activity_Activity( $comment->id );
	$comment_activity->privacy = $privacy;
	$comment_activity->save();

	if ( !empty( $comment->children ) ) {
		foreach ( $comment->children as $child_comment ) {
			bp_activity_comment_privacy_update( $child_comment, $privacy );
		}
	}
}

Changelog

Changelog
Version Description
BuddyBoss 1.4.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.