Signature
do_action( 'mam_reviews_review_submitted', array $payload, array $submission, array $result );
| Parameter | Type | Description |
|---|---|---|
$payload |
array |
The raw decoded request body from the app (e.g. post_id/order_id, review_text, ratings, photos, tip fields). |
$submission |
array |
The normalized submission core handed the provider: post_id, post_type, user (WP_User), review_text, ratings (criterion id => value), photos (attachment ids), tip_amount, tip_level, is_approved. |
$result |
array |
The provider’s save_review() result: { ok: bool, comment_id: int|null, message: string }. |
When it fires
After a mam_submit_review AJAX submission has been validated, rate-limited, and successfully saved by the owning provider — just before the success response is returned. It does not fire on validation failure or when the provider reports ok = false.
For shop_order posts, mam_reviews_add_vendor_review fires first (vendor/tips handling), then this hook fires for everything.
Example — react to a new review
add_action( 'mam_reviews_review_submitted', function ( array $payload, array $submission, array $result ) {
if ( empty( $result['ok'] ) ) {
return;
}
$post_id = (int) $submission['post_id'];
$stars = (int) ( $submission['ratings']['overall'] ?? 0 );
// e.g. feed the review text into an AI summary, notify the listing owner, …
}, 10, 3 );
(MAM ABI Now uses this hook to add review content to its AI pipeline.)
Notes
- The review is already persisted when this fires; this is a notify/augment point, not a veto.
- Use
$submission(normalized, sanitized) in preference to$payload(raw) where possible.
Related articles
- How reviews are stored and read (provider model)
- Hook:
mam_reviews_swipe_submitted - Hook:
mam_reviews_add_vendor_review
Metadata
| Field | Value |
|---|---|
| Article type | Hook Reference |
| Plugin slug | mam-reviews-manager |
| Applies to plugin version | 26.23.0+ |
| Category | Extending MAM Suite |
| Hook type | action |
| Audience | PHP developer |
| Last verified | 2026-06-04 |
