BP_Akismet::mark_as_ham( BP_Activity_Activity $activity, string $source )

Mark activity item as ham.

Description

Parameters

$activity

(Required) Activity item being hammed.

$source

(Required) Either "by_a_person" (e.g. a person has manually marked the activity as ham) or "by_akismet" (automatically hammed).

Source

File: bp-activity/classes/class-bp-akismet.php

	public function mark_as_ham( $activity, $source ) {
		// If the activity was, originally, automatically marked as spam by Akismet, run the @mentions filter as it would have been skipped.
		if ( 'true' == bp_activity_get_meta( $activity->id, '_bp_akismet_result' ) && !bp_activity_get_meta( $activity->id, '_bp_akismet_user_result' ) )
			$activity->content = bp_activity_at_name_filter( $activity->content, $activity->id );

		/**
		 * Fires after marking an activity item has been marked as ham.
		 *
		 * @since BuddyPress 1.6.0
		 *
		 * @param BP_Activity_Activity $activity Activity object being marked as ham.
		 * @param string               $source   Source of the whom marked as ham.
		 *                                       Either "by_a_person" (e.g. a person has
		 *                                       manually marked the activity as ham) or
		 *                                       "by_akismet" (automatically hammed).
		 */
		do_action( 'bp_activity_akismet_mark_as_ham', $activity, $source );
	}

Changelog

Changelog
Version Description
BuddyPress 1.6.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.