groundhogg/mappable_fields

πŸ“… Published on

πŸ“ Last updated

Documentation

Β»

Filter Hooks

Β»

groundhogg/mappable_fields

Filters the list of contact fields available for mapping in the form builder and import tools. Use this to add custom fields so they appear as mapping destinations.

apply_filters( 'groundhogg/mappable_fields', $fields );

You will receive the current associative array of field keys and labels.

Example

add_filter( 'groundhogg/mappable_fields', 'my_extension_add_mappable_fields' );

/**
 * Add custom fields to the field mapper.
 *
 * @param array $fields
 *
 * @return array
 */
function my_extension_add_mappable_fields( $fields ) {
    $fields['account_tier']     = __( 'Account Tier', 'my-extension' );
    $fields['referral_source']  = __( 'Referral Source', 'my-extension' );

    return $fields;
}

Was this helpful?

Let us know if this document answered your question. That’s the only way we can improve.