Hook: mam_wc_pv_process_vendor_registration

Signature

do_action( 'mam_wc_pv_process_vendor_registration', int $user_id, string $role );
Parameter Type Description
$user_id int Existing WordPress user id to become the vendor’s first admin
$role string Role to set on the user, e.g. wc_product_vendors_pending_vendor (manual approval) or wc_product_vendors_manager_vendor

What the registered handler does

This plugin attaches the canonical handler (priority 10), which runs vendor_registration_form_process():

  1. Inserts a new wcpv_product_vendors term named firstname-lastname-userid (term args filterable via WCPV’s own wcpv_registration_term_args).
  2. Sets the term’s vendor_data meta with the user as the only admin.
  3. Copies the user’s billing meta (address, city, state, zip, phone) into the vendor’s term metas and geocodes the address (requires the tsl-google-api-key option for coordinates).
  4. Marks the vendor type as parent.
  5. Replaces the user’s role with $role (via wp_update_user).
  6. Emails the site admin_email a “New Seller Account Pending” notice.

When to fire it

Fire it from your own plugin when you need a vendor created for a user you’ve already provisioned — this is the REPO_BOUNDARIES-compliant alternative to instantiating mam_woocommerce_product_vendors_general_functions directly. For example, mam-woocommerce-ride-share registers each approved driver as a vendor:

do_action( 'mam_wc_pv_process_vendor_registration', $user_id, 'wc_product_vendors_manager_vendor' );

Notes

  • The handler does not check capabilities — the caller is responsible for deciding the user may become a vendor and for choosing a safe $role. Do not pass roles taken from request input; validate against mam_pv_assignable_roles semantics first.
  • The role is set, not added: the user’s previous role is replaced.
  • The full app sign-up flow (user creation, notifications, mam_wc_pv_vendor_registration_completed) is the Sign up as Vendor form — this action is only the vendor-creation core.
  • The action only has a handler when WooCommerce Product Vendors is active; guard with has_action()/did_action() if your plugin may run without it.


Metadata

Field Value
Article type Hook Reference
Plugin slug mam-woocommerce-product-vendors
Applies to plugin version 26.19.1+
Category Extending MAM Suite
Hook type action
Audience PHP developer / integrator
Last verified 2026-06-10
Contents

    Need Support?

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