BP_REST_Reply_Actions_Endpoint::rest_update_reply_spam( int $reply_id, boolean $value )
Update Reply to be in spam.
Description
Parameters
- $reply_id
-
(Required) Reply ID.
- $value
-
(Required) Action value.
Return
(bool|mixed)
Source
File: bp-forums/classes/class-bp-rest-reply-actions-endpoint.php
559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 | 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.