Alerts overlay: show messages approved after later donations (recent mode with client-side dedupe)
Test and Release / test (push) Successful in 1m10s
Test and Release / release (push) Successful in 5s

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
shadowdaoandClaude Sonnet 5.5 committed 2026-11-15 12:26:03 -08:00
1 parent 875ca42054
commit f7ff1dc717
7 files changed
+170 -24

No files matched your search

+3 -1
View File
@@ -24,6 +24,7 @@ final class OverlayController {
'permission_callback' => '__return_true', // capability is the unguessable token, checked in handle()
'args' => array(
'since' => array( 'type' => 'integer', 'minimum' => 0, 'sanitize_callback' => 'absint' ),
'recent' => array( 'type' => 'integer', 'minimum' => 0, 'maximum' => 1, 'sanitize_callback' => 'absint' ),
),
) );
}
@@ -47,7 +48,8 @@ final class OverlayController {
return new \WP_Error( 'sg_not_found', 'Not found.', array( 'status' => 404 ) );
}
$since = $req->has_param( 'since' ) && '' !== (string) $req->get_param( 'since' ) ? absint( $req->get_param( 'since' ) ) : null;
$payload = ( new OverlayService( new WpdbDataSource() ) )->payload( (string) $req['widget'], time(), $since );
$recent = $req->has_param( 'recent' ) && 1 === absint( $req->get_param( 'recent' ) );
$payload = ( new OverlayService( new WpdbDataSource() ) )->payload( (string) $req['widget'], time(), $since, $recent );
if ( null === $payload ) {
return new \WP_Error( 'sg_not_found', 'Not found.', array( 'status' => 404 ) );
}