Activity::delete( $args,  $assoc_args )

Delete an activity.


Description Description

Top ↑

OPTIONS OPTIONS

… : ID or IDs of activities to delete.
[–yes] : Answer yes to the confirmation message.
## EXAMPLES
$ wp bp activity delete 958695 Success: Activity deleted.
$ wp bp activity delete 500 –yes Success: Activity deleted.


Source Source

File: cli/src/activity.php

	public function delete( $args, $assoc_args ) {
		WP_CLI::confirm( 'Are you sure you want to delete this activity?', $assoc_args );

		parent::_delete( $args, $assoc_args, function( $activity_id ) {
			$args = array(
				'id' => $this->get_activity_id_from_identifier( $activity_id ),
			);

			if ( bp_activity_delete( $args ) ) {
				return array( 'success', 'Activity deleted.' );
			} else {
				return array( 'error', 'Could not delete the activity.' );
			}
		} );
	}


Top ↑

User Contributed Notes User Contributed Notes

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