Activity::delete_comment( $args,  $assoc_args )

Delete an activity comment.

Description Description

Top ↑


: Identifier for the activity.
–comment-id= : ID of the comment to delete.
[–yes] : Answer yes to the confirmation message.
$ wp bp activity delete_comment 100 –comment-id=500 Success: Activity comment deleted.
$ wp bp activity delete_comment 165 –comment-id=35435 –yes Success: Activity comment deleted.

Source Source

File: cli/src/activity.php

	public function delete_comment( $args, $assoc_args ) {
		$activity_id = $this->get_activity_id_from_identifier( $args[0] );

		WP_CLI::confirm( 'Are you sure you want to delete this activity comment?', $assoc_args );

		// Delete Comment. True if deleted.
		if ( bp_activity_delete_comment( $activity_id, $assoc_args['comment-id'] ) ) {
			WP_CLI::success( 'Activity comment deleted.' );
		} else {
			WP_CLI::error( 'Could not delete the activity comment.' );

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.