When it fires
After a listing owner’s reply to a review has been stored, on both first save and later edits. The reviewer’s push notification is sent by Reviews Manager itself on first save only; this hook is for anything else that should happen with the reply.
MAM Chat Manager listens here to deliver private replies as a chat message from the listing to the reviewer.
Signature
do_action( 'mam_reviews_reply_saved', array $reply, array $review, bool $is_new );
| Argument | Contents |
|---|---|
$reply |
id, post_id, author_id, content, visibility (public or private), datestamp |
$review |
id, post_id, user_id (0 for a guest review), content, post_type |
$is_new |
true on the first save, false when the owner edited an existing reply |
Example
add_action( 'mam_reviews_reply_saved', function ( $reply, $review, $is_new ) {
if ( ! $is_new || 'private' !== $reply['visibility'] ) {
return;
}
// Hand the private reply to your own messaging.
}, 10, 3 );
Related
mam_reviews_reply_deletedfires with( array $reply, int $review_id )when a reply is removed.mam_reviews_user_can_replyfilters who may reply:( bool $allowed, int $post_id, int $user_id ).mam_reviews_reply_responder_namefilters the name a reply is signed with (default: the listing title).
Metadata
| Article type | Hook |
| Plugin slug | mam-reviews-manager |
| Applies to plugin version | 26.36.0 and later |
| Category | Extending MAM Suite |
| Hook type | Action |
| Audience | Developers |
