Hook: mam_reviews_reply_saved

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 );
  • mam_reviews_reply_deleted fires with ( array $reply, int $review_id ) when a reply is removed.
  • mam_reviews_user_can_reply filters who may reply: ( bool $allowed, int $post_id, int $user_id ).
  • mam_reviews_reply_responder_name filters 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
Was this article helpful?
Contents

    Need Support?

    Can't find the answer you're looking for? Don't worry we're here to help!