BP_REST_Reply_Actions_Endpoint::rest_update_reply_spam( int $reply_id, boolean $value )

Update Reply to be in spam.

Description

Parameters

$reply_id

(int) (Required) Reply ID.

$value

(boolean) (Required) Action value.

Return

(bool|mixed)

Source

File: bp-forums/classes/class-bp-rest-reply-actions-endpoint.php

	protected function rest_update_reply_spam( $reply_id, $value ) {

		$status  = true;
		$is_spam = bbp_is_reply_spam( $reply_id );

		// Subscribed and unsubscribing.
		if ( true === $is_spam && empty( $value ) ) {
			$status = bbp_unspam_reply( $reply_id );

			// Not subscribed and subscribing.
		} elseif ( false === $is_spam && ! empty( $value ) ) {
			$status = bbp_spam_reply( $reply_id );
		}

		return $status;
	}

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.