Signature
$result = apply_filters( 'mam_stripe_approved_vendors', array() );
mam-stripe-manager implements this filter. Applying it runs the vendor approval scan: the plugin walks all connected Stripe accounts (auto-paginated, so platforms with more than 100 accounts are fully covered) and, for every account with payouts_enabled that maps to a known Product Vendors vendor, sets stripe_approved = true and syncs the acct_… id into the vendor’s taxonomy_{id}_metas option and stripe_data term meta.
| Parameter | Type | Description |
|---|---|---|
$result |
array |
Ignored on input (the MAM cron manager passes array()); replaced by the scan result. |
Returns
array(
'last_run' => 'Jun 10, 2026 14:00:00', // gmdate
'status' => 'success',
)
(The underlying scan also produces the list of approved vendor ids; the direct-AJAX variant returns it as results.)
How it runs in practice
- Hourly cron — when the vendor enrollment form is bound (option
mam_stripe_send_link), the plugin registers the cron entry “Stripe fetch all approved vendors” (frequency 60 minutes) with the MAM cron manager, which applies this filter on schedule. This is what flips vendors to approved when they finish Stripe onboarding without revisiting the return page. - On demand (admin-ajax) — the same handler is exposed as the
mam_stripe_approved_vendorsadmin-ajax action. Because the scan hits Stripe for every connected account and rewrites vendor meta, direct requests require store-manager capability (manage_woocommerce, overridable via themam_stripe_user_can_managefilter); unauthorized callers get{"status":"failed","message":"Not authorized"}. Authorized calls return the result plusresultsand a confirmationmessage. - Programmatically — apply the filter from your own code, e.g. right after a vendor finishes a custom onboarding step.
Example — force a rescan after custom onboarding
// e.g. after importing vendors, refresh their Stripe approval state now
$result = apply_filters( 'mam_stripe_approved_vendors', array() );
if ( ( $result['status'] ?? '' ) === 'success' ) {
// vendor meta is up to date; safe to show payout-ready badges
}
Notes
- The scan requires WooCommerce Product Vendors; with it inactive the scan is skipped and
['approved' => []]is recorded internally. - A single-vendor fast path exists inside the service (
update_account_status( $vendor_id )) and is used by the Connect return flow; the filter always runs the full scan.
Related articles
- Recipe: Stripe Connect vendor onboarding
- Hooks: Stripe security filters
Metadata
| Field | Value |
|---|---|
| Article type | Hook Reference |
| Plugin slug | mam-stripe-manager |
| Applies to plugin version | 26.19.1+ |
| Category | Extending MAM Suite |
| Hook type | filter (implemented by this plugin) + admin-ajax action |
| Audience | PHP developer |
| Last verified | 2026-06-10 |
