Hook: mam_wc_ride_share_request_form_data

Signature

$form = apply_filters( 'mam_wc_ride_share_request_form_data', array $form );
Parameter Type Description
$form array The app-ready form definition for the configured ride request Gravity Form, as built by MAM’s Gravity Forms manager (get_data_for_app()): form meta plus a fields array (each field with id, value, type info, etc.).

Return the (modified) form array.


When it fires

While building the rider home screen, after the ride request form (option mam_wc_ride_share_ride_share) has been loaded and immediately before it is appended to the global app form array that backs the “Order Ride” button. It runs on every home-screen build for riders without an active ride, so the current user is available via mam_user_id().

It does not fire for the manager “Assign” flow — that flow builds its own copy of the form (pre-seeded driver id, credit-card field excluded).


Example — prefill and trim the form

add_filter( 'mam_wc_ride_share_request_form_data', function ( $form ) {

    // Prefill the pickup address street with the user's billing street.
    $street_field_id = get_option( 'my_pickup_street_field_id' );
    if ( $street_field_id && isset( $form['fields'] ) ) {
        foreach ( $form['fields'] as $i => $field ) {
            if ( $field['id'] == $street_field_id ) {
                $form['fields'][ $i ]['value'] = get_user_meta( mam_user_id(), 'billing_address_1', true );
            }
        }
    }

    // Hide a field from the app without editing the Gravity Form.
    $form['custom_form_excluded_fields'][] = get_option( 'my_internal_field_id' );

    return $form;
} );

Notes

  • To change which fields exist in the mapping itself (add slugs the settings screen can map), use the mam_wc_ride_share_fields filter instead — it filters the field-mapping catalog, not the runtime payload.
  • The submission lands in book_ride() via mam_form_manager_form_submitted_{form_id}; values you prefill arrive there like user-entered ones.

  • Plugin: mam-woocommerce-ride-share
  • Recipe: Set up a ride-share service

Metadata

Field Value
Article type Hook Reference
Plugin slug mam-woocommerce-ride-share
Applies to plugin version 1.3.1+
Category Extending MAM Suite
Hook type filter
Audience PHP developer
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!